Sha256: e0a08ac42f56fb4ad4064ada780b52ec67a5d0d8fbc145bb1353c46af4a36385
Contents?: true
Size: 1.45 KB
Versions: 38
Compression:
Stored size: 1.45 KB
Contents
require 'helper' RSpec.describe Flipper::Actor do it 'initializes with and knows flipper_id' do actor = described_class.new("User;235") expect(actor.flipper_id).to eq("User;235") end describe '#eql?' do it 'returns true if same class and flipper_id' do actor1 = described_class.new("User;235") actor2 = described_class.new("User;235") expect(actor1.eql?(actor2)).to be(true) end it 'returns false if same class but different flipper_id' do actor1 = described_class.new("User;235") actor2 = described_class.new("User;1") expect(actor1.eql?(actor2)).to be(false) end it 'returns false for different class' do actor1 = described_class.new("User;235") actor2 = Struct.new(:flipper_id).new("User;235") expect(actor1.eql?(actor2)).to be(false) end end describe '#==' do it 'returns true if same class and flipper_id' do actor1 = described_class.new("User;235") actor2 = described_class.new("User;235") expect(actor1.==(actor2)).to be(true) end it 'returns false if same class but different flipper_id' do actor1 = described_class.new("User;235") actor2 = described_class.new("User;1") expect(actor1.==(actor2)).to be(false) end it 'returns false for different class' do actor1 = described_class.new("User;235") actor2 = Struct.new(:flipper_id).new("User;235") expect(actor1.==(actor2)).to be(false) end end end
Version data entries
38 entries across 38 versions & 1 rubygems