Permalink
Browse files

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.
  • Loading branch information...
1 parent 45f23ab commit 2aca56e34e4039c6577ce34fcadcf87eede5c431 @myronmarston myronmarston committed Oct 3, 2012
Showing with 16 additions and 2 deletions.
  1. +6 −2 lib/rspec/core/mocking/with_rspec.rb
  2. +10 −0 spec/rspec/core/configuration_spec.rb
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

0 comments on commit 2aca56e

Please sign in to comment.