hobby-test 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/hobby-test.gemspec +1 -1
- data/lib/hobby/test/exchange/assert.rb +18 -8
- data/spec/apps/main.rb +1 -1
- data/spec/yml/passing/0.yml +1 -1
- data/spec/yml/passing/headers.yml +10 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a384dfdc98bfcbaf05e4d60a9555ecad3ad1ed1
|
4
|
+
data.tar.gz: ad4976cbbf499a72cc67adcc8e02044869ce2e44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3836b972568d143e1713e720f93dab9fa04cb8cdc710e66b4ddb87b9dff865ec5eea9a98a8dd7f61d377c2959d25d4e2389071aac6d0caf96bd377f229345b1
|
7
|
+
data.tar.gz: 7abdd424b0b9b2ef3e0f27f9a218a1b21b54ceec6c868193fd778733de94141348c282995e04da3d9137705b61396b70cd2c4e359d7f75273f7ecc8154783a7f
|
data/hobby-test.gemspec
CHANGED
@@ -18,6 +18,14 @@ class Hobby::Test::Exchange
|
|
18
18
|
dup.assert response
|
19
19
|
end
|
20
20
|
|
21
|
+
def compare_chain
|
22
|
+
if chain.end_with? '>', '=', '<'
|
23
|
+
actual_value.instance_eval "#{chain}(#{specified_value})"
|
24
|
+
else
|
25
|
+
(actual_value.instance_eval chain) == specified_value
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
21
29
|
attr_reader :actual_value, :specified_value, :chain, :key
|
22
30
|
|
23
31
|
class Status
|
@@ -30,6 +38,16 @@ class Hobby::Test::Exchange
|
|
30
38
|
end
|
31
39
|
end
|
32
40
|
|
41
|
+
class Headers
|
42
|
+
include Assert
|
43
|
+
|
44
|
+
def assert response
|
45
|
+
@actual_value = response.public_send key
|
46
|
+
@ok = chain.empty? ? actual_value == specified_value : compare_chain
|
47
|
+
self
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
33
51
|
class Body
|
34
52
|
include Assert
|
35
53
|
|
@@ -49,14 +67,6 @@ class Hobby::Test::Exchange
|
|
49
67
|
|
50
68
|
self
|
51
69
|
end
|
52
|
-
|
53
|
-
def compare_chain
|
54
|
-
if chain.end_with? '>', '=', '<'
|
55
|
-
actual_value.instance_eval "#{chain}(#{specified_value})"
|
56
|
-
else
|
57
|
-
(actual_value.instance_eval chain) == specified_value
|
58
|
-
end
|
59
|
-
end
|
60
70
|
end
|
61
71
|
end
|
62
72
|
end
|
data/spec/apps/main.rb
CHANGED
data/spec/yml/passing/0.yml
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hobby-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anatoly Chernow
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- spec/yml/passing/chain_assertions.yml
|
69
69
|
- spec/yml/passing/counter.yml
|
70
70
|
- spec/yml/passing/echo.yml
|
71
|
+
- spec/yml/passing/headers.yml
|
71
72
|
- spec/yml/passing/query.yml
|
72
73
|
- useful_links
|
73
74
|
homepage:
|