title: Boolean comparison in rspec error
body: <p>In Rspec, I'm trying to test the approximative return value of a function.</p>
  
  <p>I defined the following : </p>
  
  <pre><code>def approx_equals(val, expected, perc_error_accepted)
      margin = (expected * perc_error_accepted / 100)
      return val &gt;= expected - margin &amp;&amp; val &lt;= expected + margin
  end
  </code></pre>
  
  <p>and now I want to test my function in this way :</p>
  
  <pre><code>describe Foo do
    context "comparing return values" do
      expect(approx_equals(obj.datas[:bar], 500, 10)).to eq(true)
    end
  end
  </code></pre>
  
  <p>But I got the following error : <code>undefined method 'expect' for #&lt;Class:0x3cf5340&gt; (NoMethodError)</code></p>
  
  <p>I tried the following too : </p>
  
  <pre><code>describe Foo do
    context "comparing return values" do
      approx_equals(obj.datas[:bar], 500, 10).should == true
    end
  end
  </code></pre>
  
  <p>But rspec stopped its execution in case of a fail so that was not a good solution for me.</p>
  
  <p>What am I doing wrong?</p>