purchase 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
@@ -16,25 +16,19 @@ Feature: Purchase Committee Calculations
|
|
16
16
|
Then the committee should have used quorum "from purchase amount and tax"
|
17
17
|
And the conclusion of the committee should be "9.00"
|
18
18
|
|
19
|
-
Scenario:
|
19
|
+
Scenario: Adjusted cost committee from default
|
20
20
|
Given a purchase emitter
|
21
|
-
When the "
|
21
|
+
When the "adjusted_cost" committee is calculated
|
22
22
|
Then the committee should have used quorum "default"
|
23
|
-
|
24
|
-
|
25
|
-
Scenario: Adjusted cost committee starting from nothing
|
26
|
-
Given a purchase emitter
|
27
|
-
When the "date" committee is calculated
|
28
|
-
And the "cost" committee is calculated
|
29
|
-
And the "adjusted_cost" committee is calculated
|
30
|
-
Then the conclusion of the committee should be "516.98426"
|
23
|
+
And the conclusion of the committee should be "517.00"
|
31
24
|
|
32
25
|
Scenario Outline: Adjusted cost committee from cost and date
|
33
26
|
Given a purchase emitter
|
34
27
|
And a characteristic "cost" of "<cost>"
|
35
28
|
And characteristic "date" of "<date>"
|
36
29
|
When the "adjusted_cost" committee is calculated
|
37
|
-
Then the
|
30
|
+
Then the committee should have used quorum "from cost and date"
|
31
|
+
And the conclusion of the committee should be "<adjusted_cost>"
|
38
32
|
Examples:
|
39
33
|
| cost | date | adjusted_cost |
|
40
34
|
| 831.23 | 2010-08-01 | 688.67439 |
|
@@ -4,7 +4,7 @@ Feature: Purchase Emissions Calculations
|
|
4
4
|
Scenario: Calculations starting from nothing
|
5
5
|
Given a purchase has nothing
|
6
6
|
When emissions are calculated
|
7
|
-
Then the emission value should be within "0.001" kgs of "789.
|
7
|
+
Then the emission value should be within "0.001" kgs of "789.625"
|
8
8
|
|
9
9
|
Scenario: Calculations starting from purchase amount
|
10
10
|
Given a purchase has "purchase_amount" of "107.11"
|
@@ -14,7 +14,7 @@ Feature: Purchase Emissions Calculations
|
|
14
14
|
Scenario: Calculations starting from date
|
15
15
|
Given a purchase has "date" of "2010-07-28"
|
16
16
|
When emissions are calculated
|
17
|
-
Then the emission value should be within "0.001" kgs of "789.
|
17
|
+
Then the emission value should be within "0.001" kgs of "789.625"
|
18
18
|
|
19
19
|
Scenario Outline: Calculations starting from a merchant
|
20
20
|
Given a purchase has "merchant.id" of "<id>"
|
@@ -22,8 +22,8 @@ Feature: Purchase Emissions Calculations
|
|
22
22
|
Then the emission value should be within "0.001" kgs of "<emission>"
|
23
23
|
Examples:
|
24
24
|
| id | emission |
|
25
|
-
| 1 | 789.
|
26
|
-
| 2 | 1710.
|
25
|
+
| 1 | 789.625 |
|
26
|
+
| 2 | 1710.633 |
|
27
27
|
|
28
28
|
Scenario Outline: Calculations starting from a merchant with purchase amount
|
29
29
|
Given a purchase has "merchant.id" of "<id>"
|
@@ -162,7 +162,6 @@ module BrighterPlanet
|
|
162
162
|
end
|
163
163
|
end
|
164
164
|
|
165
|
-
# FIXME TODO 11/15/2010
|
166
165
|
# NAICS 339991 chosen because it's emissions intensity is close to the average of the entire U.S. economy
|
167
166
|
# (calculated by multiplying each sector's emissions intensity by it's share of total 2002 value)
|
168
167
|
quorum 'default' do
|
@@ -219,6 +218,12 @@ module BrighterPlanet
|
|
219
218
|
|
220
219
|
characteristics[:cost].to_f / conversion_factor
|
221
220
|
end
|
221
|
+
|
222
|
+
# This is the average federal government purchase card transaction in 2003, converted to 2002 dollars, with tax taken out
|
223
|
+
# See http://www.sba.gov/advo/research/rs226tot.pdf
|
224
|
+
quorum 'default' do
|
225
|
+
517
|
226
|
+
end
|
222
227
|
end
|
223
228
|
|
224
229
|
committee :cost do
|
@@ -230,13 +235,6 @@ module BrighterPlanet
|
|
230
235
|
quorum 'from purchase amount', :needs => :purchase_amount do |characteristics|
|
231
236
|
characteristics[:purchase_amount].to_f / 1.0711
|
232
237
|
end
|
233
|
-
|
234
|
-
# FIXME TODO 11/15/2010
|
235
|
-
# This is the average federal government purchase card transaction in 2003, converted to 2010 dollars, with tax taken out
|
236
|
-
# See http://www.sba.gov/advo/research/rs226tot.pdf
|
237
|
-
quorum 'default' do
|
238
|
-
624
|
239
|
-
end
|
240
238
|
end
|
241
239
|
|
242
240
|
committee :date do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: purchase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 11
|
10
|
+
version: 1.0.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andy Rossmeissl
|
@@ -19,7 +19,7 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2010-11-
|
22
|
+
date: 2010-11-22 00:00:00 -05:00
|
23
23
|
default_executable:
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|