Sha256: f70c9075d09ad1367f8ace7afaa4ee8db96dd8a5fa173bf7daf7dac56b423677

Contents?: true

Size: 630 Bytes

Versions: 30

Compression:

Stored size: 630 Bytes

Contents

require "spec_helper"

describe "double" do
  it "is an alias for stub and mock" do
    expect(double()).to be_a(RSpec::Mocks::Mock)
  end

  it "uses 'Double' in failure messages" do
    double = double('name')
    expect {double.foo}.to raise_error(/Double "name" received/)
  end

  describe "deprecated aliases" do
    it "warns if #stub is used" do
      expect(RSpec).to receive(:deprecate).with("stub", :replacement => "double")
      stub("TestDouble")
    end

    it "warns if #mock is used" do
      expect(RSpec).to receive(:deprecate).with("mock", :replacement => "double")
      mock("TestDouble")
    end
  end
end

Version data entries

30 entries across 30 versions & 8 rubygems

Version Path
dxruby_rp5-0.0.1 spec/vendor/rspec-mocks-2.14.4/spec/rspec/mocks/double_spec.rb
mango-0.7.0 vendor/bundler/ruby/2.0.0/gems/rspec-mocks-2.14.4/spec/rspec/mocks/double_spec.rb
rspec-mocks-2.14.4 spec/rspec/mocks/double_spec.rb
clickable_link-0.0.2 vendor/bundle/ruby/1.9.1/gems/rspec-mocks-2.14.3/spec/rspec/mocks/double_spec.rb
syllable_counter-1.0.0 vendor/bundle/gems/rspec-mocks-2.14.3/spec/rspec/mocks/double_spec.rb
rspec-mocks-2.14.3 spec/rspec/mocks/double_spec.rb
rspec-mocks-2.14.2 spec/rspec/mocks/double_spec.rb
rspec-mocks-2.14.1 spec/rspec/mocks/double_spec.rb
rspec-mocks-2.14.0 spec/rspec/mocks/double_spec.rb
rspec-mocks-2.14.0.rc1 spec/rspec/mocks/double_spec.rb