fuel_purchase 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
@@ -40,7 +40,8 @@ Feature: Fuel Purchase Committee Calculations
|
|
40
40
|
And a characteristic "cost" of "<cost>"
|
41
41
|
And a characteristic "price" of "<price>"
|
42
42
|
When the "volume" committee is calculated
|
43
|
-
Then the
|
43
|
+
Then the committee should have used quorum "from cost and price"
|
44
|
+
And the conclusion of the committee should be "<volume>"
|
44
45
|
Examples:
|
45
46
|
| cost | price | volume |
|
46
47
|
| 12.0 | 3.0 | 4.0 |
|
@@ -50,7 +51,8 @@ Feature: Fuel Purchase Committee Calculations
|
|
50
51
|
Given a fuel purchase emitter
|
51
52
|
And a characteristic "fuel_type.name" of "<fuel>"
|
52
53
|
When the "volume" committee is calculated
|
53
|
-
Then the
|
54
|
+
Then the committee should have used quorum "from fuel type"
|
55
|
+
And the conclusion of the committee should be "<volume>"
|
54
56
|
Examples:
|
55
57
|
| fuel | volume |
|
56
58
|
| Residential Natural Gas | 6221.98 |
|
@@ -58,7 +60,7 @@ Feature: Fuel Purchase Committee Calculations
|
|
58
60
|
Scenario Outline: Volume comittee from default
|
59
61
|
Given a fuel purchase emitter
|
60
62
|
When the "volume" committee is calculated
|
61
|
-
|
63
|
+
And the conclusion of the committee should be "<volume>"
|
62
64
|
Examples:
|
63
65
|
| volume |
|
64
66
|
| 100 |
|
@@ -67,7 +69,8 @@ Feature: Fuel Purchase Committee Calculations
|
|
67
69
|
Given a fuel purchase emitter
|
68
70
|
And a characteristic "fuel_type.name" of "<fuel_type>"
|
69
71
|
When the "emission_factor" committee is calculated
|
70
|
-
Then the
|
72
|
+
Then the committee should have used quorum "from fuel type"
|
73
|
+
And the conclusion of the committee should be "<factor>"
|
71
74
|
Examples:
|
72
75
|
| fuel_type | factor |
|
73
76
|
| Industrial Coking Coal | 2.720 |
|
@@ -78,4 +81,5 @@ Feature: Fuel Purchase Committee Calculations
|
|
78
81
|
Scenario: Emission factor committee from default
|
79
82
|
Given a fuel purchase emitter
|
80
83
|
When the "emission_factor" committee is calculated
|
81
|
-
Then the
|
84
|
+
Then the committee should have used quorum "default"
|
85
|
+
And the conclusion of the committee should be "1.0"
|
@@ -5,7 +5,7 @@ Feature: Fuel Purchase Emissions Calculations
|
|
5
5
|
Given a fuel purchase has "fuel_type.name" of "<fuel_type>"
|
6
6
|
And it has "cost" of "<cost>"
|
7
7
|
When emissions are calculated
|
8
|
-
Then the emission value should be within 0.1 kgs of <emission>
|
8
|
+
Then the emission value should be within "0.1" kgs of "<emission>"
|
9
9
|
Examples:
|
10
10
|
| fuel_type | cost | emission |
|
11
11
|
| Industrial Coking Coal | 100.0 | 2089.1 |
|
@@ -16,4 +16,4 @@ Feature: Fuel Purchase Emissions Calculations
|
|
16
16
|
Scenario: Default fuel purchase emission
|
17
17
|
Given a fuel purchase has "emission" of ""
|
18
18
|
When emissions are calculated
|
19
|
-
Then the emission value should be within 0.1 kgs of 100
|
19
|
+
Then the emission value should be within "0.1" kgs of "100"
|
@@ -1,10 +1,7 @@
|
|
1
|
-
require 'leap'
|
2
|
-
|
3
1
|
module BrighterPlanet
|
4
2
|
module FuelPurchase
|
5
3
|
module CarbonModel
|
6
4
|
def self.included(base)
|
7
|
-
base.extend ::Leap::Subject
|
8
5
|
base.decide :emission, :with => :characteristics do
|
9
6
|
committee :emission do
|
10
7
|
quorum 'from volume and emission factor', :needs => [:volume, :emission_factor] do |characteristics|
|
data/lib/fuel_purchase/data.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fuel_purchase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 11
|
10
|
+
version: 0.0.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andy Rossmeissl
|
@@ -19,48 +19,46 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2010-09-
|
22
|
+
date: 2010-09-22 00:00:00 -04:00
|
23
23
|
default_executable:
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
|
-
|
26
|
+
type: :development
|
27
27
|
prerelease: false
|
28
|
-
|
28
|
+
name: activerecord
|
29
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
29
30
|
none: false
|
30
31
|
requirements:
|
31
|
-
- -
|
32
|
+
- - ~>
|
32
33
|
- !ruby/object:Gem::Version
|
33
|
-
hash:
|
34
|
+
hash: 7
|
34
35
|
segments:
|
35
36
|
- 3
|
36
37
|
- 0
|
37
38
|
- 0
|
38
|
-
|
39
|
-
|
40
|
-
type: :development
|
41
|
-
version_requirements: *id001
|
39
|
+
version: 3.0.0
|
40
|
+
requirement: *id001
|
42
41
|
- !ruby/object:Gem::Dependency
|
43
|
-
|
42
|
+
type: :development
|
44
43
|
prerelease: false
|
45
|
-
|
44
|
+
name: bundler
|
45
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
46
46
|
none: false
|
47
47
|
requirements:
|
48
|
-
- -
|
48
|
+
- - ~>
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
hash:
|
50
|
+
hash: 23
|
51
51
|
segments:
|
52
52
|
- 1
|
53
53
|
- 0
|
54
54
|
- 0
|
55
|
-
|
56
|
-
|
57
|
-
version: 1.0.0.beta.2
|
58
|
-
type: :development
|
59
|
-
version_requirements: *id002
|
55
|
+
version: 1.0.0
|
56
|
+
requirement: *id002
|
60
57
|
- !ruby/object:Gem::Dependency
|
61
|
-
|
58
|
+
type: :development
|
62
59
|
prerelease: false
|
63
|
-
|
60
|
+
name: cucumber
|
61
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
64
62
|
none: false
|
65
63
|
requirements:
|
66
64
|
- - "="
|
@@ -71,12 +69,12 @@ dependencies:
|
|
71
69
|
- 8
|
72
70
|
- 3
|
73
71
|
version: 0.8.3
|
74
|
-
|
75
|
-
version_requirements: *id003
|
72
|
+
requirement: *id003
|
76
73
|
- !ruby/object:Gem::Dependency
|
77
|
-
|
74
|
+
type: :development
|
78
75
|
prerelease: false
|
79
|
-
|
76
|
+
name: jeweler
|
77
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
80
78
|
none: false
|
81
79
|
requirements:
|
82
80
|
- - "="
|
@@ -87,12 +85,12 @@ dependencies:
|
|
87
85
|
- 4
|
88
86
|
- 0
|
89
87
|
version: 1.4.0
|
90
|
-
|
91
|
-
version_requirements: *id004
|
88
|
+
requirement: *id004
|
92
89
|
- !ruby/object:Gem::Dependency
|
93
|
-
|
90
|
+
type: :development
|
94
91
|
prerelease: false
|
95
|
-
|
92
|
+
name: rake
|
93
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
96
94
|
none: false
|
97
95
|
requirements:
|
98
96
|
- - ">="
|
@@ -101,12 +99,12 @@ dependencies:
|
|
101
99
|
segments:
|
102
100
|
- 0
|
103
101
|
version: "0"
|
104
|
-
|
105
|
-
version_requirements: *id005
|
102
|
+
requirement: *id005
|
106
103
|
- !ruby/object:Gem::Dependency
|
107
|
-
|
104
|
+
type: :development
|
108
105
|
prerelease: false
|
109
|
-
|
106
|
+
name: rdoc
|
107
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
110
108
|
none: false
|
111
109
|
requirements:
|
112
110
|
- - ">="
|
@@ -115,12 +113,12 @@ dependencies:
|
|
115
113
|
segments:
|
116
114
|
- 0
|
117
115
|
version: "0"
|
118
|
-
|
119
|
-
version_requirements: *id006
|
116
|
+
requirement: *id006
|
120
117
|
- !ruby/object:Gem::Dependency
|
121
|
-
|
118
|
+
type: :development
|
122
119
|
prerelease: false
|
123
|
-
|
120
|
+
name: rspec
|
121
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
124
122
|
none: false
|
125
123
|
requirements:
|
126
124
|
- - "="
|
@@ -133,15 +131,15 @@ dependencies:
|
|
133
131
|
- beta
|
134
132
|
- 17
|
135
133
|
version: 2.0.0.beta.17
|
136
|
-
|
137
|
-
version_requirements: *id007
|
134
|
+
requirement: *id007
|
138
135
|
- !ruby/object:Gem::Dependency
|
139
|
-
|
136
|
+
type: :development
|
140
137
|
prerelease: false
|
141
|
-
|
138
|
+
name: sniff
|
139
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
142
140
|
none: false
|
143
141
|
requirements:
|
144
|
-
- -
|
142
|
+
- - ~>
|
145
143
|
- !ruby/object:Gem::Version
|
146
144
|
hash: 21
|
147
145
|
segments:
|
@@ -149,24 +147,23 @@ dependencies:
|
|
149
147
|
- 1
|
150
148
|
- 7
|
151
149
|
version: 0.1.7
|
152
|
-
|
153
|
-
version_requirements: *id008
|
150
|
+
requirement: *id008
|
154
151
|
- !ruby/object:Gem::Dependency
|
155
|
-
|
152
|
+
type: :runtime
|
156
153
|
prerelease: false
|
157
|
-
|
154
|
+
name: emitter
|
155
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
158
156
|
none: false
|
159
157
|
requirements:
|
160
|
-
- -
|
158
|
+
- - ~>
|
161
159
|
- !ruby/object:Gem::Version
|
162
|
-
hash:
|
160
|
+
hash: 19
|
163
161
|
segments:
|
164
162
|
- 0
|
165
|
-
- 0
|
166
163
|
- 1
|
167
|
-
|
168
|
-
|
169
|
-
|
164
|
+
- 4
|
165
|
+
version: 0.1.4
|
166
|
+
requirement: *id009
|
170
167
|
description: A software model in Ruby for the greenhouse gas emissions of a fuel purchase
|
171
168
|
email: andy@rossmeissl.net
|
172
169
|
executables: []
|