dont error on comparison of license with nil

This commit is contained in:
Ben Balter 2015-09-01 10:51:21 -04:00
parent f8c51c5351
commit b264699dd9
3 changed files with 3 additions and 2 deletions

View File

@ -115,7 +115,7 @@ class Licensee
end
def ==(other)
key == other.key
other != nil && key == other.key
end
private

View File

@ -1,3 +1,3 @@
class Licensee
VERSION = "5.0.0b2"
VERSION = "5.0.0b3"
end

View File

@ -37,6 +37,7 @@ class TestLicenseeLicense < Minitest::Test
should "know license equality" do
assert @license == Licensee::License.new("MIT")
refute @license == Licensee::License.new("ISC")
refute @license == nil
end
should "know if the license is featured" do