Logo: Relish

  1. Sign up
  2. Sign in

Project: RSpec Core 2.4

mock with rspec

As an RSpec user who likes to mock
I want to be able to use rspec

Scenarios
Mock with rspec
Given
a file named "rspec_example_spec.rb" with:
RSpec.configure do |config|
  config.mock_framework = :rspec
end

describe "plugging in rspec" do
  it "allows rspec to be used" do
    target = mock('target')
    target.should_receive(:foo)
    target.foo
  end
end
When
I run "rspec ./rspec_example_spec.rb"
Then
the examples should all pass
And
the exit status should be 0

Last published over 1 year ago by dchelimsky.