sniff 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,6 +23,11 @@ Given /^(a )?characteristic "(.*)" of "(.*)"$/ do |_, name, value|
23
23
  end
24
24
  end
25
25
 
26
+ Given /^(a )?characteristic "(.*)" including "(.*)"$/ do |_, name, values|
27
+ @characteristics[name.to_sym] ||= []
28
+ @characteristics[name.to_sym] += values.split(/,/)
29
+ end
30
+
26
31
  When /^the "(.*)" committee is calculated$/ do |committee_name|
27
32
  @decision ||= @activity.decisions[:emission]
28
33
  @committee = @decision.committees.find { |c| c.name.to_s == committee_name }
@@ -33,7 +38,11 @@ When /^the "(.*)" committee is calculated$/ do |committee_name|
33
38
  args << []
34
39
  end
35
40
  @report = @committee.report *args
36
- @characteristics[committee_name.to_sym] = @report.andand.conclusion
41
+ if @report.nil?
42
+ raise "The committee #{@committee.name} did not come to a conclusion. Characteristics: #{@characteristics.inspect}"
43
+ else
44
+ @characteristics[committee_name.to_sym] = @report.andand.conclusion
45
+ end
37
46
  end
38
47
 
39
48
  Then /^the committee should have used quorum "(.*)"$/ do |quorum|
@@ -72,10 +81,16 @@ end
72
81
  Then /^the conclusion of the committee should have a record identified with "(.*)" of "(.*)" and having "(.*)" of "(.*)"$/ do |id_field, id, field, value|
73
82
  id_field = id_field.to_sym
74
83
  records = @report.conclusion
75
- record = records.send("find_by_#{id_field}", id)
84
+ record = records.to_a.find { |r| r.send(id_field) == id }
76
85
  coerce_value(record.send(field)).should == coerce_value(value)
77
86
  end
78
87
 
88
+ Then /^the conclusion of the committee should have a record identified with "(.*)" of "(.*)" and having "(.*)" including "(.*)"$/ do |id_field, id, field, values|
89
+ values.split(/,/).each do |value|
90
+ Then "the conclusion of the committee should have a record identified with \"#{id_field}\" of \"#{id}\" and having \"#{field}\" of \"#{value}\""
91
+ end
92
+ end
93
+
79
94
  Then /^the conclusion of the committee should have a record with "([^"]*)" equal to "([^"]*)"$/ do |field, value|
80
95
  record = @report.conclusion
81
96
  compare_values(coerce_value(record.send(field)),value)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sniff
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Derek Kastner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-04 00:00:00 -04:00
18
+ date: 2010-08-06 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency