I have the following test:
describe "Exporter#get_method" do
before(:each) do
exporter.should_receive(:get_method).at_least(:once).and_call_original
end
it "should get the next terminal value" do
exporter.send(:get_method).should == :split
end
it "should call descend if the current value is a hash" do
exporter.should_receive(:descend).once
2.times { exporter.send(:get_method) }
end
it "should call ascend if at the end of an array and there is a prologue" do
exporter.should_receive(:ascend).once
3.times { exporter.send(:get_method) }
end
end
I can verify with a couple of binding.pry calls that ascend and descend are being called. However RSpec isn't seeing it. Where am I going wrong. I want to make sure that the method being tested does call the other methods under the correct circumstances. Is there another way to do this?