Skip to content

Commit

Permalink
Use and enforce the new rspec #expect syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
snusnu committed Jul 22, 2013
1 parent 5b10f7a commit d69239e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,10 @@ def call(request)
include Substation

RSpec.configure do |config|
config.expect_with :rspec do |c|
c.syntax = :expect
end
config.mock_with :rspec do |c|
c.syntax = :expect
end
end
2 changes: 1 addition & 1 deletion spec/unit/substation/action/call_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
let(:observers) { [ Spec::Observer ] }

before do
Spec::Observer.should_receive(:call).with(response)
expect(Spec::Observer).to receive(:call).with(response)
end

it { should eql(response) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
let(:dsl) { double }

before do
described_class.should_receive(:new).with(registry).and_return(builder)
builder.should_receive(:dsl).and_return(dsl)
expect(described_class).to receive(:new).with(registry).and_return(builder)
expect(builder).to receive(:dsl).and_return(dsl)
end

it { should be(dsl) }
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/substation/chain/each_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
let(:yields) { [] }

before do
object.should be_instance_of(described_class)
expect(object).to be_instance_of(described_class)
end

it_should_behave_like 'an #each method'

it 'yields only processors' do
subject
yields.each { |processor| processor.should be_instance_of(Spec::Processor) }
yields.each { |processor| expect(processor).to be_instance_of(Spec::Processor) }
end

it 'yields only processors with the expected handler' do
Expand All @@ -35,7 +35,7 @@
let(:processor) { Spec::FAKE_PROCESSOR }

before do
subject.should be_instance_of(described_class)
expect(subject).to be_instance_of(described_class)
end

it { should be_kind_of(Enumerable) }
Expand Down

0 comments on commit d69239e

Please sign in to comment.