riot-gear 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/riot/gear/context.rb +2 -0
- data/lib/riot/gear/context/anything.rb +24 -0
- data/lib/riot/gear/context/asserts_cookie.rb +20 -0
- data/lib/riot/gear/context/asserts_header.rb +0 -2
- data/lib/riot/gear/middleware/riotparty.rb +3 -3
- data/lib/riot/gear/version.rb +1 -1
- metadata +16 -20
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 77f4a684241452b90378fff94aeb82ff0fd13af9
|
4
|
+
data.tar.gz: 57f1bc17cb081c81c2ac446866c1ed184ca41186
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: eb29453fec11e6f2921478e9f8bc894b5428a0906d318b00c9a4b1325fb274d4a644b1ed2a5cee64fada88ed638d0bf974d62b31e59759dcfbaf8031db64174b
|
7
|
+
data.tar.gz: 4e3dce7e176523805542b7a6ca624d5e94aa1762bd5759a10d81ad94ac1b7cb9e1040193f87fdf734eb0bb1f14fb8d9688cb09baa96d90ed7a645f4ab965f6dc
|
data/lib/riot/gear/context.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'riot/gear/context/once'
|
2
|
+
require 'riot/gear/context/anything'
|
2
3
|
require 'riot/gear/context/persist_cookie'
|
3
4
|
require 'riot/gear/context/asserts_status'
|
4
5
|
require 'riot/gear/context/asserts_header'
|
6
|
+
require 'riot/gear/context/asserts_cookie'
|
5
7
|
require 'riot/gear/context/asserts_json'
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class Riot::Gear::AnythingRunnable < Riot::RunnableBlock
|
2
|
+
def initialize(description, &definition)
|
3
|
+
super("[anything] #{description}", &definition)
|
4
|
+
end
|
5
|
+
|
6
|
+
# @param [Riot::Situation] situation An instance of a {Riot::Situation}
|
7
|
+
# @return [Array<Symbol>]
|
8
|
+
def run(situation)
|
9
|
+
situation.evaluate(&definition)
|
10
|
+
[:anything]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
module Riot::Gear::AnythingContextHelper
|
15
|
+
# @param [String] description A description of what the block is for
|
16
|
+
# @param [lambda] &definition The block that will be executed ...
|
17
|
+
# @return [Riot::Gear::AnythingRunnable]
|
18
|
+
def anything(description="", &definition)
|
19
|
+
@assertions << Riot::Gear::AnythingRunnable.new(description, &definition)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
Riot::Context.instance_eval { include Riot::Gear::AnythingContextHelper }
|
24
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Riot
|
2
|
+
module Gear
|
3
|
+
module AssertsCookie
|
4
|
+
|
5
|
+
# Generates an assertion that retrieves the value of some cookie from the last response.
|
6
|
+
#
|
7
|
+
# asserts_cookie("ui_session").matches(/stuff/)
|
8
|
+
#
|
9
|
+
# @param [String] cookie-name the name of the cookie
|
10
|
+
# @return [Riot::Assertion] an assertion block that macros can be applied to
|
11
|
+
def asserts_cookie(cookie_name)
|
12
|
+
asserts("set-cookie #{cookie_name}") { cookie_values[cookie_name] }
|
13
|
+
end
|
14
|
+
|
15
|
+
end # AssertsHeader
|
16
|
+
end # Gear
|
17
|
+
end # Riot
|
18
|
+
|
19
|
+
Riot::Context.instance_eval { include Riot::Gear::AssertsCookie }
|
20
|
+
|
@@ -80,8 +80,9 @@ private
|
|
80
80
|
def proxy_action_methods(context)
|
81
81
|
context_eigen = (class << context; self; end)
|
82
82
|
actionable_methods.each do |method_name|
|
83
|
+
|
83
84
|
context_eigen.__send__(:define_method, method_name) do |*args, &settings_block|
|
84
|
-
|
85
|
+
anything do
|
85
86
|
if settings_block
|
86
87
|
name = args.first
|
87
88
|
options = instance_eval(&settings_block)
|
@@ -90,13 +91,12 @@ private
|
|
90
91
|
name = nil
|
91
92
|
path, options = *args
|
92
93
|
end
|
93
|
-
#debug_start = Time.now
|
94
94
|
result = topic.__send__(method_name, path, options || {})
|
95
|
-
#puts "TIME #{(Time.now - debug_start) * 1000.0}ms #{topic.base_uri}#{path}"
|
96
95
|
@saved_responses[name] = result
|
97
96
|
@smoke_response = result # TODO remove this after it's certain no usages in the wild
|
98
97
|
end
|
99
98
|
end
|
99
|
+
|
100
100
|
end # methods.each
|
101
101
|
end
|
102
102
|
|
data/lib/riot/gear/version.rb
CHANGED
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riot-gear
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.16
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Justin 'Gus' Knowlden
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2016-03-13 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: riot
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 0.12.6
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 0.12.6
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: httparty
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: 0.12.0
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: 0.12.0
|
46
41
|
description: Riot + HTTParty smoke testing framework. You'd use it for integration
|
@@ -50,9 +45,9 @@ executables: []
|
|
50
45
|
extensions: []
|
51
46
|
extra_rdoc_files: []
|
52
47
|
files:
|
53
|
-
- .gitignore
|
54
|
-
- .travis.yml
|
55
|
-
- .yardopts
|
48
|
+
- ".gitignore"
|
49
|
+
- ".travis.yml"
|
50
|
+
- ".yardopts"
|
56
51
|
- CHANGELOG
|
57
52
|
- Gemfile
|
58
53
|
- MIT-LICENSE
|
@@ -60,6 +55,8 @@ files:
|
|
60
55
|
- Rakefile
|
61
56
|
- lib/riot/gear.rb
|
62
57
|
- lib/riot/gear/context.rb
|
58
|
+
- lib/riot/gear/context/anything.rb
|
59
|
+
- lib/riot/gear/context/asserts_cookie.rb
|
63
60
|
- lib/riot/gear/context/asserts_header.rb
|
64
61
|
- lib/riot/gear/context/asserts_json.rb
|
65
62
|
- lib/riot/gear/context/asserts_status.rb
|
@@ -85,27 +82,26 @@ files:
|
|
85
82
|
- test/teststrap.rb
|
86
83
|
homepage: http://github.com/thumblemonks/riot-gear
|
87
84
|
licenses: []
|
85
|
+
metadata: {}
|
88
86
|
post_install_message:
|
89
87
|
rdoc_options: []
|
90
88
|
require_paths:
|
91
89
|
- lib
|
92
90
|
required_ruby_version: !ruby/object:Gem::Requirement
|
93
|
-
none: false
|
94
91
|
requirements:
|
95
|
-
- -
|
92
|
+
- - ">="
|
96
93
|
- !ruby/object:Gem::Version
|
97
94
|
version: '0'
|
98
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
-
none: false
|
100
96
|
requirements:
|
101
|
-
- -
|
97
|
+
- - ">="
|
102
98
|
- !ruby/object:Gem::Version
|
103
99
|
version: '0'
|
104
100
|
requirements: []
|
105
101
|
rubyforge_project:
|
106
|
-
rubygems_version:
|
102
|
+
rubygems_version: 2.2.2
|
107
103
|
signing_key:
|
108
|
-
specification_version:
|
104
|
+
specification_version: 4
|
109
105
|
summary: Riot + HTTParty smoke testing framework.
|
110
106
|
test_files:
|
111
107
|
- test/actions/delete_test.rb
|