sniff 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Sniff
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
@@ -64,18 +64,22 @@ Then /^the calculation should have used committees "(.*)"$/ do |committee_list|
64
64
  end
65
65
 
66
66
  Then /^the calculation should comply with standards? "(.*)"$/ do |standard_list|
67
- standards = standard_list.split(/,\s*/).map(&:to_sym)
68
- compliance = @activity.deliberations[:emission].compliance
67
+ standards = Set.new standard_list.split(/,\s*/).map(&:to_sym)
68
+ compliance = Set.new @activity.deliberations[:emission].compliance
69
69
  unless standards.empty?
70
70
  compliance.should_not be_empty, 'Expected calculation to comply with some standards, but it complied with none'
71
71
  end
72
- (compliance - standards).should be_empty
72
+ exclusive_list = (compliance ^ standards)
73
+ exclusive_list.should be_empty, "Calculation did not comply with #{(standards - compliance).to_a.inspect})"
73
74
  end
74
75
 
75
76
  Then /^the calculation should not comply with standards? "(.*)"$/ do |standard_list|
76
- standards = standard_list.split(/,\s*/).map(&:to_sym)
77
- compliance = @activity.deliberations[:emission].compliance
78
- (compliance - standards).should == compliance
77
+ standards = Set.new standard_list.split(/,\s*/).map(&:to_sym)
78
+ compliance = Set.new @activity.deliberations[:emission].compliance
79
+ unless compliance.empty?
80
+ diff_list = (standards - compliance) # s - c = set of anything in s that is not in c
81
+ diff_list.should be(standards), "Calculation should not have complied with #{(standards - diff_list).to_a.inspect}"
82
+ end
79
83
  end
80
84
 
81
85
  Then /^the (.+) committee should be close to "([^,]+)", \+\/-"(.+)"$/ do |committee, value, cusion|
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: sniff
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.7.2
5
+ version: 0.7.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Derek Kastner
@@ -10,7 +10,8 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-27 00:00:00 Z
13
+ date: 2011-05-27 00:00:00 -04:00
14
+ default_executable:
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: activesupport
@@ -193,7 +194,6 @@ files:
193
194
  - lib/sniff.rb
194
195
  - lib/test_support/cucumber/step_definitions/carbon_steps.rb
195
196
  - lib/test_support/cucumber/step_definitions/committee_steps.rb
196
- - lib/test_support/cucumber/step_definitions/data_steps.rb
197
197
  - lib/test_support/cucumber/step_definitions/temporal_steps.rb
198
198
  - lib/test_support/cucumber/support/values.rb
199
199
  - lib/test_support/db/fixtures/census_divisions.csv
@@ -208,8 +208,6 @@ files:
208
208
  - lib/test_support/db/fixtures/urbanities.csv
209
209
  - lib/test_support/db/fixtures/zip_codes.csv
210
210
  - README.markdown
211
- - spec/db/emitter_data.sqlite3
212
- - spec/db/schema_output
213
211
  - spec/fixtures/dirigible/lib/dirigible/carbon_model.rb
214
212
  - spec/fixtures/dirigible/lib/dirigible/characterization.rb
215
213
  - spec/fixtures/dirigible/lib/dirigible/data.rb
@@ -230,6 +228,7 @@ files:
230
228
  - spec/lib/sniff/rake_tasks_spec.rb
231
229
  - spec/lib/test_support/cucumber/support/values_spec.rb
232
230
  - spec/spec_helper.rb
231
+ has_rdoc: true
233
232
  homepage: http://github.com/brighterplanet/sniff
234
233
  licenses: []
235
234
 
@@ -243,7 +242,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
243
242
  requirements:
244
243
  - - ">="
245
244
  - !ruby/object:Gem::Version
246
- hash: 416302750492710009
245
+ hash: 4317022014224165339
247
246
  segments:
248
247
  - 0
249
248
  version: "0"
@@ -256,13 +255,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
255
  requirements: []
257
256
 
258
257
  rubyforge_project:
259
- rubygems_version: 1.8.3
258
+ rubygems_version: 1.6.2
260
259
  signing_key:
261
260
  specification_version: 3
262
261
  summary: Test support for Brighter Planet carbon gems
263
262
  test_files:
264
- - spec/db/emitter_data.sqlite3
265
- - spec/db/schema_output
266
263
  - spec/fixtures/dirigible/lib/dirigible/carbon_model.rb
267
264
  - spec/fixtures/dirigible/lib/dirigible/characterization.rb
268
265
  - spec/fixtures/dirigible/lib/dirigible/data.rb
@@ -1,32 +0,0 @@
1
- Given /^an? "([^\"]*)" data import fetches results listed in "(.*)"$/ do |model, file_name|
2
- @data_import_model = model.constantize
3
- table_name = @data_import_model.table_name
4
-
5
- fixture_path = File.expand_path("features/support/imports/#{file_name}", Dir.pwd)
6
-
7
- fixture = Fixtures.new @data_import_model.connection, table_name, model, fixture_path
8
-
9
- @data_import_model.connection.transaction(:requires_new => true) do
10
- fixture.delete_existing_fixtures
11
- fixture.insert_fixtures
12
- end
13
- end
14
-
15
- When /^a data import verifies "(.*)"$/ do |verification_step_name|
16
- @verification = @data_import_model.data_miner_base.steps.find { |f|
17
- f.respond_to?(:description) and f.description == verification_step_name
18
- }
19
- @verification_result = begin
20
- @verification.run true
21
- true
22
- rescue => e
23
- false
24
- end
25
- end
26
-
27
- Then /^the verification should be successful$/ do
28
- @verification_result.should be_true
29
- end
30
- Then /^the verification should not be successful$/ do
31
- @verification_result.should be_false
32
- end
File without changes
File without changes