Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Delegate #configuration through to rspec-mocks. #699

Closed
wants to merge 1 commit into from

2 participants

@myronmarston
Owner

This allows our block config API to be used.

This depends on rspec/rspec-mocks#188 and should be merged after that.

@myronmarston myronmarston Delegate #configuration through to rspec-mocks.
This allows our block config API to be used.

This depends on rspec/rspec-mocks#188 and should be merged after that.
2aca56e
@myronmarston
Owner

The travis failures are expected...this won't pass until we merge the rspec-mocks PR first since it depends upon RSpec::Mocks.configuration being defined.

@dchelimsky
Owner

Love it!

@myronmarston
Owner

Merged in 44ff59b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 3, 2012
  1. @myronmarston

    Delegate #configuration through to rspec-mocks.

    myronmarston authored
    This allows our block config API to be used.
    
    This depends on rspec/rspec-mocks#188 and should be merged after that.
This page is out of date. Refresh to see the latest.
View
8 lib/rspec/core/mocking/with_rspec.rb
@@ -3,9 +3,13 @@
module RSpec
module Core
module MockFrameworkAdapter
-
+
def self.framework_name; :rspec end
-
+
+ def self.configuration
+ RSpec::Mocks.configuration
+ end
+
def setup_mocks_for_rspec
RSpec::Mocks::setup(self)
end
View
10 spec/rspec/core/configuration_spec.rb
@@ -94,6 +94,16 @@ module RSpec::Core
end
end
+ it "allows rspec-mocks to be configured with a provided block" do
+ mod = Module.new
+
+ RSpec::Mocks.configuration.should_receive(:add_stub_and_should_receive_to).with(mod)
+
+ config.mock_with :rspec do |c|
+ c.add_stub_and_should_receive_to mod
+ end
+ end
+
context "with a module" do
it "sets the mock_framework_adapter to that module" do
mod = Module.new
Something went wrong with that request. Please try again.