Sha256: e4da0c4d541b35a1ddcbc6294ad509a99a6563c4a11e9f7ec889f0d5d3dc9cfd

Contents?: true

Size: 620 Bytes

Versions: 30

Compression:

Stored size: 620 Bytes

Contents

require 'spec_helper'

module RSpec
  module Matchers
    describe "expect(actual).to be_close(expected, delta)" do
      before(:each) do
        allow(RSpec).to receive(:deprecate)
      end

      it "is deprecated" do
        expect(RSpec).to receive(:deprecate).with(/be_close.*/, :replacement => "be_within(0.5).of(3.0)")
        be_close(3.0, 0.5)
      end

      it "delegates to be_within(delta).of(expected)" do
        should_receive(:be_within).with(0.5).and_return( be_within_matcher = double )
        be_within_matcher.should_receive(:of).with(3.0)
        be_close(3.0, 0.5)
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 8 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/be_close_spec.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/be_close_spec.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/be_close_spec.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/be_close_spec.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/be_close_spec.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/be_close_spec.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/be_close_spec.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/spec/rspec/matchers/be_close_spec.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-expectations-2.14.5/spec/rspec/matchers/be_close_spec.rb
dxruby_rp5-0.0.4 spec/vendor/rspec-expectations-2.14.4/spec/rspec/matchers/be_close_spec.rb
rspec-expectations-2.14.5 spec/rspec/matchers/be_close_spec.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-expectations-2.14.4/spec/rspec/matchers/be_close_spec.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/rspec-expectations-2.14.4/spec/rspec/matchers/be_close_spec.rb
dxruby_rp5-0.0.3 spec/vendor/rspec-expectations-2.14.4/spec/rspec/matchers/be_close_spec.rb
tuktuk-rails-0.0.10 vendor/bundle/ruby/2.0.0/gems/rspec-expectations-2.14.4/spec/rspec/matchers/be_close_spec.rb
tuktuk-rails-0.0.9 vendor/bundle/ruby/2.0.0/gems/rspec-expectations-2.14.4/spec/rspec/matchers/be_close_spec.rb
tuktuk-rails-0.0.8 vendor/bundle/ruby/2.0.0/gems/rspec-expectations-2.14.4/spec/rspec/matchers/be_close_spec.rb
tuktuk-rails-0.0.7 vendor/bundle/ruby/2.0.0/gems/rspec-expectations-2.14.4/spec/rspec/matchers/be_close_spec.rb
dxruby_rp5-0.0.2 spec/vendor/rspec-expectations-2.14.4/spec/rspec/matchers/be_close_spec.rb
dxruby_rp5-0.0.1 spec/vendor/rspec-expectations-2.14.4/spec/rspec/matchers/be_close_spec.rb