Sha256: 722c9c44002d925b9038e4affa94a00750a9d8ab4e9487defb729e4b51cfef39

Contents?: true

Size: 628 Bytes

Versions: 15

Compression:

Stored size: 628 Bytes

Contents

# encoding: utf-8

RSpec.describe TTY::Prompt::Choice, '#==' do
  it "is true with the same name and value attributes" do
    expect(described_class.new(:large, 1)).
      to eq(described_class.new(:large, 1))
  end

  it "is false with different name attribute" do
    expect(described_class.new(:large, 1)).
      not_to eq(described_class.new(:medium, 1))
  end

  it "is false with different value attribute" do
    expect(described_class.new(:large, 1)).
      not_to eq(described_class.new(:large, 2))
  end

  it "is false with non-choice object" do
    expect(described_class.new(:large, 1)).not_to eq(:other)
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
tty-prompt-0.17.2 spec/unit/choice/eql_spec.rb
tty-prompt-0.17.1 spec/unit/choice/eql_spec.rb
tty-prompt-0.17.0 spec/unit/choice/eql_spec.rb
tty-prompt-0.12.0 spec/unit/choice/eql_spec.rb
tty-prompt-0.11.0 spec/unit/choice/eql_spec.rb
tty-prompt-0.10.1 spec/unit/choice/eql_spec.rb
tty-prompt-0.10.0 spec/unit/choice/eql_spec.rb
tty-prompt-0.9.0 spec/unit/choice/eql_spec.rb
tty-prompt-0.8.0 spec/unit/choice/eql_spec.rb
tty-prompt-0.7.1 spec/unit/choice/eql_spec.rb
tty-prompt-0.7.0 spec/unit/choice/eql_spec.rb
tty-prompt-0.6.0 spec/unit/choice/eql_spec.rb
tty-prompt-0.5.0 spec/unit/choice/eql_spec.rb
tty-prompt-0.4.0 spec/unit/choice/eql_spec.rb
tty-prompt-0.3.0 spec/unit/choice/eql_spec.rb