sniff 0.7.0 → 0.7.1
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/sniff/version.rb
CHANGED
@@ -63,6 +63,18 @@ Then /^the calculation should have used committees "(.*)"$/ do |committee_list|
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
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
|
69
|
+
(compliance - standards).should be_empty
|
70
|
+
end
|
71
|
+
|
72
|
+
Then /^the calculation should not comply with standards? "(.*)"$/ do |standard_list|
|
73
|
+
standards = standard_list.split(/,\s*/).map(&:to_sym)
|
74
|
+
compliance = @activity.deliberations[:emission].compliance
|
75
|
+
(compliance - standards).should == compliance
|
76
|
+
end
|
77
|
+
|
66
78
|
Then /^the (.+) committee should be close to "([^,]+)", \+\/-"(.+)"$/ do |committee, value, cusion|
|
67
79
|
@characteristics[committee.to_sym].to_f.should be_within(cusion.to_f).of(value.to_f)
|
68
80
|
end
|
@@ -59,11 +59,31 @@ When /^the "(.*)" committee is calculated$/ do |committee_name|
|
|
59
59
|
# end
|
60
60
|
end
|
61
61
|
|
62
|
-
Then /^
|
62
|
+
Then /^then a report should exist for the committee$/ do
|
63
63
|
raise "Missing report for committee #{@committee.name}" if @report.nil?
|
64
|
+
end
|
65
|
+
|
66
|
+
Then /^the committee should have used quorum "(.*)"$/ do |quorum|
|
67
|
+
Then 'then a report should exist for the committee'
|
64
68
|
@report.quorum.name.should == quorum
|
65
69
|
end
|
66
70
|
|
71
|
+
Then /^the conclusion should comply with standards? "(.*)"$/ do |standard_list|
|
72
|
+
Then 'then a report should exist for the committee'
|
73
|
+
standards = standard_list.split(/,\s*/)
|
74
|
+
standards.each do |standard|
|
75
|
+
@report.quorum.compliance.map(&:to_s).should include(standard)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
Then /^the conclusion should not comply with standards? "(.*)"$/ do |standard_list|
|
80
|
+
Then 'then a report should exist for the committee'
|
81
|
+
standards = standard_list.split(/,\s*/)
|
82
|
+
standards.each do |standard|
|
83
|
+
@report.quorum.compliance.map(&:to_s).should_not include(standard)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
67
87
|
Then /^the conclusion of the committee should be "(.*)"$/ do |conclusion|
|
68
88
|
compare_values(@report.andand.conclusion, conclusion)
|
69
89
|
end
|
@@ -0,0 +1,32 @@
|
|
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
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: sniff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.7.
|
5
|
+
version: 0.7.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Derek Kastner
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-27 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -193,6 +193,7 @@ files:
|
|
193
193
|
- lib/sniff.rb
|
194
194
|
- lib/test_support/cucumber/step_definitions/carbon_steps.rb
|
195
195
|
- lib/test_support/cucumber/step_definitions/committee_steps.rb
|
196
|
+
- lib/test_support/cucumber/step_definitions/data_steps.rb
|
196
197
|
- lib/test_support/cucumber/step_definitions/temporal_steps.rb
|
197
198
|
- lib/test_support/cucumber/support/values.rb
|
198
199
|
- lib/test_support/db/fixtures/census_divisions.csv
|
@@ -242,7 +243,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
242
243
|
requirements:
|
243
244
|
- - ">="
|
244
245
|
- !ruby/object:Gem::Version
|
245
|
-
hash: -
|
246
|
+
hash: -3204111369250944856
|
246
247
|
segments:
|
247
248
|
- 0
|
248
249
|
version: "0"
|