[rspec-users] Am I missing something with Heckle?

Ashley Moran work at ashleymoran.me.uk
Tue Oct 30 20:05:41 EDT 2007


I can't get heckle working.  In fact, I've built an example so simple  
that it either shows a bug, or I am being really, REALLY stupid.

Heckle does not appear to support RSpec directly, so I'm trying to use  
spec --heckle (RSpec trunk as of 10 mins ago, Heckle 1.4.1).  I've  
constructed this pair of sample files:

   18> ~/Desktop/heckle_test % cat lib/cow.rb
   class Cow
     def moo

   19> ~/Desktop/heckle_test % cat spec/cow_spec.rb
   require 'rubygems'
   require 'spec'

   require File.dirname(__FILE__) + '/../lib/cow.rb'

   describe Cow do
     it "should moo when sent :moo" do
       cow = Cow.new
       # cow.moo.should == "moo"

So, my thinking is, the spec should pass (nothing in the one example  
to make it fail).  Then heckle should change "moo" to "dfhgd5rgvsev"  
or some other randomness, then it should expect "Cow should moo when  
sent :moo" to *fail*, which of course it won't, because I commented  
out the line that checks that.

Also, if I manually violate the example, spec proceeds to heckle anyway:

   25> ~/Desktop/heckle_test % spec --heckle Cow spec/cow_spec.rb

   'Cow should moo when sent :moo' FAILED

   Finished in 0.00767 seconds

   1 example, 1 failure
   ***  Cow#moo loaded with 1 possible mutations

   1 mutations remaining...
   No mutants survived. Cool!

What's going on?  None of this is behaviour I expect.


blog @ http://aviewfromafar.net/
linked-in @ http://www.linkedin.com/in/ashleymoran
currently @ home

More information about the rspec-users mailing list