Skip to content

Commit

Permalink
Delegate #configuration through to rspec-mocks.
Browse files Browse the repository at this point in the history
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
myronmarston committed Oct 6, 2012
1 parent 51a31c9 commit 44ff59b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/rspec/core/mocking/with_rspec.rb
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions spec/rspec/core/configuration_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit 44ff59b

Please sign in to comment.