sniff 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,8 +15,8 @@ Given /^(a )?characteristic "(.*)" of "(.*)"$/ do |_, name, value|
15
15
  end
16
16
  value = model.send "find_by_#{attribute}", value
17
17
  @characteristics[model_name.to_sym] = value
18
- elsif name == 'timeframe' and value.present?
19
- @characteristics[name.to_sym] = Timeframe.interval value
18
+ elsif name == 'timeframe'
19
+ @characteristics[name.to_sym] = (value.present?) ? Timeframe.interval(value) : nil
20
20
  else
21
21
  value = coerce_value(value)
22
22
  @characteristics[name.to_sym] = value
@@ -18,7 +18,7 @@ def coerce_value(value)
18
18
  end
19
19
 
20
20
  def compare_values(a, b)
21
- if b.nil?
21
+ if b.nil? or b.empty?
22
22
  a.should be_nil
23
23
  elsif a.is_a? Date or a.is_a? Time
24
24
  b = Date.parse b
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: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
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-03 00:00:00 -04:00
18
+ date: 2010-08-04 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency