diff --git a/spec/y2r_spec.rb b/spec/y2r_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/y2r_spec.rb
+++ b/spec/y2r_spec.rb
@@ -182,12 +182,15 @@ describe Y2R do
       it "compiles unary operators" do
         ycp_code = cleanup(<<-EOT)
           {
-            integer i = ~42;
+            # Using a variable defeats constant propagation.
+            integer i = 42;
+            integer j = -i;
           }
         EOT
 
         ruby_code = cleanup(<<-EOT)
-          i = Ops.bitwise_not(42)
+          i = 42
+          j = Ops.unary_minus(i)
         EOT
 
         Y2R.compile(ycp_code).should == ruby_code
Use more natural operator in unary operator integration test