kosher 0.2.17 → 0.2.18

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.
data/lib/kosher/book.rb CHANGED
@@ -3,7 +3,7 @@ module Kosher
3
3
  def best_kosher_offer
4
4
  offer = offers.sort.first
5
5
 
6
- offer.kosher? ? offer : nil
6
+ (offer && offer.kosher?) ? offer : nil
7
7
  end
8
8
  end
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module Kosher
2
- VERSION = '0.2.17'
2
+ VERSION = '0.2.18'
3
3
  end
@@ -66,6 +66,12 @@ module Kosher
66
66
  @book.best_kosher_offer.should be_nil
67
67
  end
68
68
  end
69
+
70
+ context "when there are no offers" do
71
+ it "returns nil" do
72
+ @book.best_kosher_offer.should be_nil
73
+ end
74
+ end
69
75
  end
70
76
  end
71
77
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: kosher
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.17
5
+ version: 0.2.18
6
6
  platform: ruby
7
7
  authors:
8
8
  - Paper Cavalier