Sha256: 6167ba4a12392e1ac0391ebf14d7df042cdacc52a776347afd4c27bc61f01733

Contents?: true

Size: 1.1 KB

Versions: 9

Compression:

Stored size: 1.1 KB

Contents

module RSpec
  module Matchers
    RSpec.describe "eql" do
      it_behaves_like "an RSpec matcher", :valid_value => 1, :invalid_value => 2 do
        let(:matcher) { eql(1) }
      end

      it "is diffable" do
        expect(eql(1)).to be_diffable
      end

      it "matches when actual.eql?(expected)" do
        expect(1).to eql(1)
      end

      it "does not match when !actual.eql?(expected)" do
        expect(1).not_to eql(2)
      end

      it "describes itself" do
        matcher = eql(1)
        matcher.matches?(1)
        expect(matcher.description).to eq "eql 1"
      end

      it "provides message, expected and actual on #failure_message" do
        matcher = eql("1")
        matcher.matches?(1)
        expect(matcher.failure_message).to eq "\nexpected: \"1\"\n     got: 1\n\n(compared using eql?)\n"
      end

      it "provides message, expected and actual on #negative_failure_message" do
        matcher = eql(1)
        matcher.matches?(1)
        expect(matcher.failure_message_when_negated).to eq "\nexpected: value != 1\n     got: 1\n\n(compared using eql?)\n"
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
opal-rspec-0.6.2 rspec-expectations/spec/rspec/matchers/built_in/eql_spec.rb
opal-rspec-0.6.1 rspec-expectations/spec/rspec/matchers/built_in/eql_spec.rb
opal-rspec-0.6.0 rspec-expectations/spec/rspec/matchers/built_in/eql_spec.rb
opal-rspec-0.6.0.beta1 rspec-expectations/spec/rspec/matchers/built_in/eql_spec.rb
opal-connect-rspec-0.5.0 rspec-expectations/spec/rspec/matchers/built_in/eql_spec.rb
opal-rspec-0.5.0 rspec-expectations/spec/rspec/matchers/built_in/eql_spec.rb
opal-rspec-0.5.0.beta3 rspec-expectations/spec/rspec/matchers/built_in/eql_spec.rb
opal-rspec-0.5.0.beta2 rspec-expectations/spec/rspec/matchers/built_in/eql_spec.rb
opal-rspec-0.5.0.beta1 rspec-expectations/spec/rspec/matchers/built_in/eql_spec.rb