Skip to content

Commit

Permalink
Enable the :expect syntax by default.
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Phippen <samphippen@googlemail.com>
  • Loading branch information
Sam Phippen committed May 10, 2013
1 parent a15b91e commit 563e2f5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
15 changes: 0 additions & 15 deletions features/message_expectations/expect_message_using_expect.feature
Expand Up @@ -4,21 +4,10 @@ Feature: expect message using `expect`
`object` should receive the message `:message` before the example is
completed.

Background:
Given a file named "spec/spec_helper.rb" with:
"""ruby
RSpec.configure do |config|
config.mock_with :rspec do |mocks|
mocks.syntax = :expect
end
end
"""

Scenario: expect a message
Given a file named "spec/account_spec.rb" with:
"""ruby
require "account"
require "spec_helper"
describe Account do
context "when closed" do
Expand Down Expand Up @@ -48,7 +37,6 @@ Feature: expect message using `expect`
Given a file named "spec/account_spec.rb" with:
"""ruby
require "account"
require "spec_helper"
describe Account do
context "when closed" do
Expand Down Expand Up @@ -77,7 +65,6 @@ Feature: expect message using `expect`
Scenario: provide a return value
Given a file named "spec/message_expectation_spec.rb" with:
"""ruby
require "spec_helper"
describe "a message expectation with a return value" do
context "specified in a block" do
Expand All @@ -103,8 +90,6 @@ Feature: expect message using `expect`
Scenario: expect a specific number of calls
Given a file named "spec/message_count_spec.rb" with:
"""ruby
require "spec_helper"
describe "a message expectation with a count" do
it "passes if the expected number of calls happen" do
string = "hi"
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/mocks/configuration.rb
Expand Up @@ -49,7 +49,7 @@ def self.configuration
@configuration ||= Configuration.new
end

configuration.syntax = :should
configuration.syntax = [:should, :expect]
end
end

4 changes: 2 additions & 2 deletions spec/rspec/mocks/configuration_spec.rb
Expand Up @@ -35,9 +35,9 @@ def sandboxed
let(:should_class_methods) { [:any_instance] }
let(:expect_methods) { [:receive, :allow, :expect_any_instance_of, :allow_any_instance_of] }

it 'defaults to only enabling the :should syntax' do
it 'defaults to enabling both the :should and :expect syntaxes' do
expect(dbl).to respond_to(*should_methods)
expect(self).not_to respond_to(*expect_methods)
expect(self).to respond_to(*expect_methods)
end

context 'when configured to :expect' do
Expand Down

0 comments on commit 563e2f5

Please sign in to comment.