lita 4.3.0 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82c5e0d68ab472c4415df6cad75ebdf1fe52fd56
4
- data.tar.gz: 7d7ff0871dbc15991a0edb9cf1526a4c49d53366
3
+ metadata.gz: 6adaec62407df746e96dc8c3ff5ee2149cb63ad9
4
+ data.tar.gz: 9543cb670c104ef5869072b5b695f2f8a7a1227b
5
5
  SHA512:
6
- metadata.gz: 6326e3526c0a63f9cba4a8b0fadbed2312a3c29321e3833e1b4ddaedd10ee7dbfa5cc060c4c115ca3c8251b150aa0fb5bad8ea9174376429c23281ec710d8632
7
- data.tar.gz: 21f439582fe5b648ba954924ee9743b29a7a50f457507a7f5966f586eca96f9845d608f584a57d7c4f3d54d0fbfcdd535c235a89192183a479143595cdd3b8e7
6
+ metadata.gz: 2da5ab958353ca917d05585682639a967608ac5f200156dd9638bf8a29e5108174e3505bec1bc1570e51b235d369eb74054a948cc9dba0c15167f3d23b7a221e
7
+ data.tar.gz: f1cbee5f4a72e166f2250f0bc45c0e87aef25692dcbc06db169c5ef6628117b4a3d156bd2edf4e96d5f57b7683e8d4d60f83bea2f9fe42fa8e776bf8b7aa4b1d
data/lib/lita/user.rb CHANGED
@@ -120,6 +120,12 @@ module Lita
120
120
  def ==(other)
121
121
  other.respond_to?(:id) && id == other.id && other.respond_to?(:name) && name == other.name
122
122
  end
123
+ alias_method :eql?, :==
124
+
125
+ def hash
126
+ id.hash ^
127
+ name.hash
128
+ end
123
129
 
124
130
  private
125
131
 
data/lib/lita/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Lita
2
2
  # The current version of Lita.
3
- VERSION = "4.3.0"
3
+ VERSION = "4.3.1"
4
4
  end
@@ -127,16 +127,25 @@ describe Lita::User, lita: true do
127
127
  end
128
128
  end
129
129
 
130
- describe "#==" do
130
+ describe "equality" do
131
131
  it "considers two users equal if they share an ID and name" do
132
132
  user1 = described_class.new(1, name: "Carl")
133
133
  user2 = described_class.new(1, name: "Carl")
134
134
  expect(user1).to eq(user2)
135
+ expect(user1).to eql(user2)
135
136
  end
136
137
 
137
138
  it "doesn't assume the comparison object is a Lita::User" do
138
139
  user = described_class.new(1, name: "Carl")
139
140
  expect(user).not_to eq("not a Lita::User object")
141
+ expect(user).not_to eql("not a Lita::User object")
142
+ end
143
+
144
+ it "consistently hashes equal users" do
145
+ user1 = described_class.new(1, name: "Carl")
146
+ user2 = described_class.new(1, name: "Carl")
147
+
148
+ expect(user1.hash).to eq(user2.hash)
140
149
  end
141
150
  end
142
151
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.0
4
+ version: 4.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Cuadra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-13 00:00:00.000000000 Z
11
+ date: 2015-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -444,4 +444,3 @@ test_files:
444
444
  - spec/templates/basic.erb
445
445
  - spec/templates/basic.irc.erb
446
446
  - spec/templates/interpolated.erb
447
- has_rdoc: