spec/cucumber/rails/database_spec.rb in cucumber-rails-1.4.1 vs spec/cucumber/rails/database_spec.rb in cucumber-rails-1.4.2

- old
+ new

@@ -4,17 +4,17 @@ describe Cucumber::Rails::Database do let(:strategy) { double(before_js: nil, before_non_js: nil) } it 'forwards events to the selected strategy' do - Cucumber::Rails::Database::TruncationStrategy.stub(new: strategy) + allow(Cucumber::Rails::Database::TruncationStrategy).to receive_messages(new: strategy) Cucumber::Rails::Database.javascript_strategy = :truncation - strategy.should_receive(:before_non_js).ordered + expect(strategy).to receive(:before_non_js).ordered Cucumber::Rails::Database.before_non_js - strategy.should_receive(:before_js).ordered + expect(strategy).to receive(:before_js).ordered Cucumber::Rails::Database.before_js end it 'raises an error if you use a non-understood strategy' do expect { Cucumber::Rails::Database.javascript_strategy = :invalid }.to raise_error(Cucumber::Rails::Database::InvalidStrategy) @@ -41,16 +41,16 @@ it 'accepts a custom strategy with a valid interface' do expect { Cucumber::Rails::Database.javascript_strategy = ValidStrategy }.not_to raise_error end it 'forwards events to a custom strategy' do - ValidStrategy.stub(new: strategy) + allow(ValidStrategy).to receive_messages(new: strategy) Cucumber::Rails::Database.javascript_strategy = ValidStrategy - strategy.should_receive(:before_non_js).ordered + expect(strategy).to receive(:before_non_js).ordered Cucumber::Rails::Database.before_non_js - strategy.should_receive(:before_js).ordered + expect(strategy).to receive(:before_js).ordered Cucumber::Rails::Database.before_js end end end