Created
May 28, 2015 09:28
-
-
Save omegahm/498ec5deed4faee5fe8a to your computer and use it in GitHub Desktop.
Weird Spec behaviour
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.. | |
Finished in 9.18 seconds (files took 8.21 seconds to load) | |
2 examples, 0 failures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path("../../../../config/environment", __FILE__) | |
require 'rspec/rails' | |
MyTestVar = '42' | |
def do_it | |
MyTestVar.to_i | |
end | |
RSpec.describe 'weird' do | |
it 'is weird' do | |
expect(MyTestVar).not_to receive(:to_i) | |
delay.do_it | |
Delayed::Worker.new.work_off | |
end | |
it 'isnt weird' do | |
expect(MyTestVar).to receive(:to_i) | |
delay.do_it | |
Delayed::Worker.new.work_off | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I set
and then of course not call
Delayed::Worker.new.work_off
everything works.