kosher 0.2.14 → 0.2.15
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/README.md +1 -1
- data/lib/kosher/{snapshot.rb → book.rb} +1 -1
- data/lib/kosher/version.rb +1 -1
- data/lib/kosher.rb +1 -1
- data/spec/kosher/{snapshot_spec.rb → book_spec.rb} +13 -13
- metadata +5 -5
data/README.md
CHANGED
data/lib/kosher/version.rb
CHANGED
data/lib/kosher.rb
CHANGED
@@ -3,6 +3,7 @@ require 'money'
|
|
3
3
|
require 'kosher/threshold'
|
4
4
|
|
5
5
|
require 'kosher/availability'
|
6
|
+
require 'kosher/book'
|
6
7
|
require 'kosher/condition'
|
7
8
|
require 'kosher/description'
|
8
9
|
require 'kosher/item'
|
@@ -10,4 +11,3 @@ require 'kosher/location'
|
|
10
11
|
require 'kosher/offer'
|
11
12
|
require 'kosher/seller'
|
12
13
|
require 'kosher/shipping'
|
13
|
-
require 'kosher/snapshot'
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
module Kosher
|
4
|
-
describe
|
4
|
+
describe Book do
|
5
5
|
describe "#best_kosher_offer" do
|
6
6
|
before do
|
7
|
-
@
|
8
|
-
@
|
7
|
+
@book = Book.new
|
8
|
+
@book.offers = []
|
9
9
|
|
10
10
|
@offer1 = Offer.new
|
11
11
|
@offer2 = Offer.new
|
@@ -15,15 +15,15 @@ module Kosher
|
|
15
15
|
before do
|
16
16
|
@offer1.stub!(:kosher?).and_return(true)
|
17
17
|
@offer1.stub!(:price).and_return(Money.new(200, 'EUR'))
|
18
|
-
@
|
18
|
+
@book.offers << @offer1
|
19
19
|
|
20
20
|
@offer2.stub!(:kosher?).and_return(true)
|
21
21
|
@offer2.stub!(:price).and_return(Money.new(100, 'EUR'))
|
22
|
-
@
|
22
|
+
@book.offers << @offer2
|
23
23
|
end
|
24
24
|
|
25
25
|
it "returns the kosher offer with the lower price" do
|
26
|
-
@
|
26
|
+
@book.best_kosher_offer.should eql @offer2
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -31,15 +31,15 @@ module Kosher
|
|
31
31
|
before do
|
32
32
|
@offer1.stub!(:kosher?).and_return(true)
|
33
33
|
@offer1.stub!(:price).and_return(Money.new(200, 'EUR'))
|
34
|
-
@
|
34
|
+
@book.offers << @offer1
|
35
35
|
|
36
36
|
@offer2.stub!(:kosher?).and_return(false)
|
37
37
|
@offer2.stub!(:price).and_return(Money.new(100, 'EUR'))
|
38
|
-
@
|
38
|
+
@book.offers << @offer2
|
39
39
|
end
|
40
40
|
|
41
41
|
it "returns the best kosher offer" do
|
42
|
-
@
|
42
|
+
@book.best_kosher_offer.should eql @offer1
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
@@ -47,11 +47,11 @@ module Kosher
|
|
47
47
|
before do
|
48
48
|
@offer1.stub!(:kosher?).and_return(true)
|
49
49
|
@offer1.stub!(:price).and_return(Money.new(100, 'EUR'))
|
50
|
-
@
|
50
|
+
@book.offers << @offer1
|
51
51
|
end
|
52
52
|
|
53
53
|
it "returns the kosher offer" do
|
54
|
-
@
|
54
|
+
@book.best_kosher_offer.should eql @offer1
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -59,11 +59,11 @@ module Kosher
|
|
59
59
|
before do
|
60
60
|
@offer1.stub!(:kosher?).and_return(false)
|
61
61
|
@offer1.stub!(:price).and_return(Money.new(100, 'EUR'))
|
62
|
-
@
|
62
|
+
@book.offers << @offer1
|
63
63
|
end
|
64
64
|
|
65
65
|
it "returns nil" do
|
66
|
-
@
|
66
|
+
@book.best_kosher_offer.should be_nil
|
67
67
|
end
|
68
68
|
end
|
69
69
|
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.
|
5
|
+
version: 0.2.15
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Paper Cavalier
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-17 00:00:00 +00:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- kosher.gemspec
|
64
64
|
- lib/kosher.rb
|
65
65
|
- lib/kosher/availability.rb
|
66
|
+
- lib/kosher/book.rb
|
66
67
|
- lib/kosher/condition.rb
|
67
68
|
- lib/kosher/description.rb
|
68
69
|
- lib/kosher/item.rb
|
@@ -70,10 +71,10 @@ files:
|
|
70
71
|
- lib/kosher/offer.rb
|
71
72
|
- lib/kosher/seller.rb
|
72
73
|
- lib/kosher/shipping.rb
|
73
|
-
- lib/kosher/snapshot.rb
|
74
74
|
- lib/kosher/threshold.rb
|
75
75
|
- lib/kosher/version.rb
|
76
76
|
- spec/kosher/availability_spec.rb
|
77
|
+
- spec/kosher/book_spec.rb
|
77
78
|
- spec/kosher/condition_spec.rb
|
78
79
|
- spec/kosher/description_spec.rb
|
79
80
|
- spec/kosher/item_spec.rb
|
@@ -81,7 +82,6 @@ files:
|
|
81
82
|
- spec/kosher/offer_spec.rb
|
82
83
|
- spec/kosher/seller_spec.rb
|
83
84
|
- spec/kosher/shipping_spec.rb
|
84
|
-
- spec/kosher/snapshot_spec.rb
|
85
85
|
- spec/spec_helper.rb
|
86
86
|
has_rdoc: true
|
87
87
|
homepage: https://rubygems.org/gems/kosher
|
@@ -113,6 +113,7 @@ specification_version: 3
|
|
113
113
|
summary: A somewhat overengineered attempt to abstract bookdealing into a set of models
|
114
114
|
test_files:
|
115
115
|
- spec/kosher/availability_spec.rb
|
116
|
+
- spec/kosher/book_spec.rb
|
116
117
|
- spec/kosher/condition_spec.rb
|
117
118
|
- spec/kosher/description_spec.rb
|
118
119
|
- spec/kosher/item_spec.rb
|
@@ -120,5 +121,4 @@ test_files:
|
|
120
121
|
- spec/kosher/offer_spec.rb
|
121
122
|
- spec/kosher/seller_spec.rb
|
122
123
|
- spec/kosher/shipping_spec.rb
|
123
|
-
- spec/kosher/snapshot_spec.rb
|
124
124
|
- spec/spec_helper.rb
|