Sha256: 47d44eee72638d44943d7690bd69f1f85642a4ad385ed9a668e03ff4a61249f5

Contents?: true

Size: 652 Bytes

Versions: 5

Compression:

Stored size: 652 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_deprecation_with_type('be_close(3.0, 0.5)',
          'be_within(0.5).of(3.0)',
          'the be_close matcher'
        )
        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

5 entries across 5 versions & 1 rubygems

Version Path
rspec-expectations-2.99.2 spec/rspec/matchers/be_close_spec.rb
rspec-expectations-2.99.1 spec/rspec/matchers/be_close_spec.rb
rspec-expectations-2.99.0 spec/rspec/matchers/be_close_spec.rb
rspec-expectations-2.99.0.rc1 spec/rspec/matchers/be_close_spec.rb
rspec-expectations-2.99.0.beta2 spec/rspec/matchers/be_close_spec.rb