barometer-support 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/barometer/support/matchers/have_field.rb +27 -9
- data/lib/barometer/support/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7fd5ebec1f822d8d909cfef44c3fed4a943175e
|
4
|
+
data.tar.gz: 4ab7ec7c4ddf5a10f45c96d048aba2da45feac34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f7cf5449c00fffdc10ba3a1d266931e8bcb4d5b5e6d12116a70d63aef67fe385b539da29818c634b6557bcc27c909edceb4832ebdd02f01c9b1d4358e43a353
|
7
|
+
data.tar.gz: c6b4ac2cdb938740fd8b0ff42974391dbc5544d96ca2af84f4f9014e6fc9fd73598a25753a8742954d9a4fee545957ee99d40ee990c40300cc5760fa44a59836
|
@@ -42,9 +42,13 @@ module Barometer
|
|
42
42
|
if type_is_time?
|
43
43
|
set_value "2013-01-01 10:15:30 am"
|
44
44
|
elsif type_is_sun?
|
45
|
-
rise = Time.utc(2013,1,1,10,15,30)
|
46
|
-
set = Time.utc(2013,1,1,18,14,56)
|
47
|
-
set_value
|
45
|
+
rise = ::Time.utc(2013,1,1,10,15,30)
|
46
|
+
set = ::Time.utc(2013,1,1,18,14,56)
|
47
|
+
set_value @type.new(rise: rise, set: set)
|
48
|
+
elsif type_is_symbol?
|
49
|
+
set_value 'foo'
|
50
|
+
elsif type_is_hash?
|
51
|
+
set_value(foo: 'bar')
|
48
52
|
else
|
49
53
|
set_value 10
|
50
54
|
end
|
@@ -54,12 +58,18 @@ module Barometer
|
|
54
58
|
def sets_value?
|
55
59
|
if type_is_time?
|
56
60
|
set_value "10 15 30 2013 01 01 am", "%H %M %S %Y %m %d %p"
|
57
|
-
assert value.to_i == Time.utc(2013,01,01,10,15,30).to_i, "expected value of '2013-01-01 10:15:30 am', got '#{print_value}'"
|
61
|
+
assert value.to_i == ::Time.utc(2013,01,01,10,15,30).to_i, "expected value of '2013-01-01 10:15:30 am', got '#{print_value}'"
|
58
62
|
elsif type_is_sun?
|
59
|
-
rise = Time.utc(2013,1,1,10,15,30)
|
60
|
-
set = Time.utc(2013,1,1,18,14,56)
|
61
|
-
set_value
|
63
|
+
rise = ::Time.utc(2013,1,1,10,15,30)
|
64
|
+
set = ::Time.utc(2013,1,1,18,14,56)
|
65
|
+
set_value @type.new(rise: rise, set: set)
|
62
66
|
assert print_value == "rise: 10:15, set: 18:14", "expected value of 'rise: 10:15, set: 18:14'', got '#{print_value}'"
|
67
|
+
elsif type_is_symbol?
|
68
|
+
set_value 'foo'
|
69
|
+
assert value == :foo, "expected value of ':foo', got '#{value}'"
|
70
|
+
elsif type_is_hash?
|
71
|
+
set_value(foo: 'bar')
|
72
|
+
assert value == {foo: 'bar'}, "expected value of '{foo: 'bar'}', got '#{value}'"
|
63
73
|
else
|
64
74
|
set_value 10
|
65
75
|
assert value.to_i == 10, "expected value of '10', got '#{value.to_i}'"
|
@@ -109,11 +119,19 @@ module Barometer
|
|
109
119
|
end
|
110
120
|
|
111
121
|
def type_is_time?
|
112
|
-
@type == Time
|
122
|
+
@type == ::Time
|
113
123
|
end
|
114
124
|
|
115
125
|
def type_is_sun?
|
116
|
-
@type
|
126
|
+
@type.to_s.end_with? 'Data::Sun'
|
127
|
+
end
|
128
|
+
|
129
|
+
def type_is_symbol?
|
130
|
+
@type == ::Symbol
|
131
|
+
end
|
132
|
+
|
133
|
+
def type_is_hash?
|
134
|
+
@type == ::Hash
|
117
135
|
end
|
118
136
|
|
119
137
|
def assert(test, failure_message)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: barometer-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Gangl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,3 +72,4 @@ signing_key:
|
|
72
72
|
specification_version: 4
|
73
73
|
summary: Barometer support files
|
74
74
|
test_files: []
|
75
|
+
has_rdoc:
|