sniff 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,11 @@ Given /^an? (.+) emitter$/ do |name|
6
6
  @characteristics ||= {}
7
7
  end
8
8
 
9
- Given /^(a )?characteristic "(.*)" of "(.*)"$/ do |_, name, value|
9
+ Given /^(a )?characteristic "(.*)" of integer value "(.*)"$/ do |_, name, value|
10
+ Given "characteristic \"#{name}\" of \"#{value}\", converted with \"to_i\""
11
+ end
12
+
13
+ Given /^(a )?characteristic "(.*)" of "([^\"]*)"(, converted with "(.*)")?$/ do |_, name, value, __, converter|
10
14
  if name =~ /\./
11
15
  model_name, attribute = name.split /\./
12
16
  model = begin
@@ -19,6 +23,9 @@ Given /^(a )?characteristic "(.*)" of "(.*)"$/ do |_, name, value|
19
23
  @characteristics[model_name.to_sym] = value
20
24
  elsif name == 'timeframe' || name == 'active_subtimeframe'
21
25
  @characteristics[name.to_sym] = (value.present?) ? Timeframe.interval(value) : nil
26
+ elsif converter
27
+ value = value.send converter
28
+ @characteristics[name.to_sym] = value
22
29
  else
23
30
  value = coerce_value(value)
24
31
  @characteristics[name.to_sym] = value
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 5
9
- version: 0.4.5
8
+ - 6
9
+ version: 0.4.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Derek Kastner
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-15 00:00:00 -05:00
17
+ date: 2010-12-16 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -325,7 +325,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
325
325
  requirements:
326
326
  - - ">="
327
327
  - !ruby/object:Gem::Version
328
- hash: 185196851
328
+ hash: -125159619
329
329
  segments:
330
330
  - 0
331
331
  version: "0"