riot-gear 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  .bundle/*
3
3
  *.tmproj
4
4
  pkg/*
5
+ .rvmrc
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -12,7 +12,9 @@ module Riot
12
12
 
13
13
  def persist_cookie(cookie_name)
14
14
  hookup do
15
- topic.cookies({cookie_name => cookie_values[cookie_name]})
15
+ if cookie_value = cookie_values[cookie_name]
16
+ topic.cookies({cookie_name => cookie_value["value"]})
17
+ end
16
18
  end
17
19
  end
18
20
  end # Http
data/riot-gear.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{riot-gear}
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin 'Gus' Knowlden"]
12
- s.date = %q{2010-07-06}
12
+ s.date = %q{2010-07-08}
13
13
  s.description = %q{Riot + HTTParty smoke testing framework. You'd use it for integration testing with real HTTP requests and responses}
14
14
  s.email = %q{gus@gusg.us}
15
15
  s.extra_rdoc_files = [
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
29
29
  "lib/riot/gear/middleware.rb",
30
30
  "lib/riot/gear/middleware/riotparty.rb",
31
31
  "riot-gear.gemspec",
32
+ "test/actions/get_test.rb",
32
33
  "test/helpers/cookie_values_test.rb",
33
34
  "test/helpers/json_path_test.rb",
34
35
  "test/riotparty_proxy_methods_test.rb",
@@ -38,10 +39,11 @@ Gem::Specification.new do |s|
38
39
  s.homepage = %q{http://github.com/thumblemonks/riot-gear}
39
40
  s.rdoc_options = ["--charset=UTF-8"]
40
41
  s.require_paths = ["lib"]
41
- s.rubygems_version = %q{1.3.6}
42
+ s.rubygems_version = %q{1.3.7}
42
43
  s.summary = %q{Riot + HTTParty smoke testing framework}
43
44
  s.test_files = [
44
- "test/helpers/cookie_values_test.rb",
45
+ "test/actions/get_test.rb",
46
+ "test/helpers/cookie_values_test.rb",
45
47
  "test/helpers/json_path_test.rb",
46
48
  "test/riotparty_proxy_methods_test.rb",
47
49
  "test/setting_up_gear_context_test.rb",
@@ -52,7 +54,7 @@ Gem::Specification.new do |s|
52
54
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
53
55
  s.specification_version = 3
54
56
 
55
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
57
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
56
58
  s.add_runtime_dependency(%q<riot>, [">= 0"])
57
59
  s.add_runtime_dependency(%q<httparty>, [">= 0"])
58
60
  s.add_development_dependency(%q<webmock>, [">= 0"])
@@ -0,0 +1,47 @@
1
+ require 'teststrap'
2
+
3
+ context "Sending a GET request" do
4
+ teardown { reset_webmock }
5
+
6
+ asserts("not defining a base_uri") do
7
+ Riot::Context.new("foo") { get "/foo" }.run(Riot::SilentReporter.new)
8
+ end.raises(HTTParty::UnsupportedURIScheme)
9
+
10
+ context "with a base-uri" do
11
+ context "without params" do
12
+ hookup do
13
+ stub_request(:get, 'http://test.local/foo').to_return(:body => "Foo", :status => 200)
14
+ end
15
+
16
+ base_uri "http://test.local"
17
+ get "/foo"
18
+
19
+ asserts("status code") { response.code }.equals(200)
20
+ asserts("response body") { response.body }.equals("Foo")
21
+ end # without params
22
+
23
+ context "with default params" do
24
+ hookup do
25
+ stub_request(:get, 'http://test.local/foo?bar=baz').to_return(:body => "", :status => 201)
26
+ end
27
+
28
+ base_uri "http://test.local"
29
+ default_params({"bar" => "baz"})
30
+ get "/foo"
31
+
32
+ asserts("status code") { response.code }.equals(201)
33
+ end # with default params
34
+
35
+ context "with inline params" do
36
+ hookup do
37
+ stub_request(:get, 'http://test.local/foo?bar=baz').to_return(:body => "", :status => 201)
38
+ end
39
+
40
+ base_uri "http://test.local"
41
+ get "/foo?bar=baz"
42
+
43
+ asserts("status code") { response.code }.equals(201)
44
+ end # with inline params
45
+ end # with a base-uri
46
+
47
+ end # Sending a GET request
data/test/teststrap.rb CHANGED
@@ -1,10 +1,11 @@
1
1
  require 'pathname'
2
2
 
3
- $:.unshift (Pathname(__FILE__).dirname + ".." + "lib").to_s
3
+ $:.unshift((Pathname(__FILE__).dirname + ".." + "lib").to_s)
4
4
 
5
5
  require 'rubygems'
6
6
  require 'riot'
7
7
  require 'webmock'
8
+ Riot::Situation.instance_eval { include WebMock }
8
9
 
9
10
  require 'riot/gear'
10
11
 
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riot-gear
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 21
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 0
8
- - 4
9
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
10
11
  platform: ruby
11
12
  authors:
12
13
  - Justin 'Gus' Knowlden
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-07-06 00:00:00 -05:00
18
+ date: 2010-07-08 00:00:00 -05:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: riot
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 3
27
30
  segments:
28
31
  - 0
29
32
  version: "0"
@@ -33,9 +36,11 @@ dependencies:
33
36
  name: httparty
34
37
  prerelease: false
35
38
  requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
36
40
  requirements:
37
41
  - - ">="
38
42
  - !ruby/object:Gem::Version
43
+ hash: 3
39
44
  segments:
40
45
  - 0
41
46
  version: "0"
@@ -45,9 +50,11 @@ dependencies:
45
50
  name: webmock
46
51
  prerelease: false
47
52
  requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
48
54
  requirements:
49
55
  - - ">="
50
56
  - !ruby/object:Gem::Version
57
+ hash: 3
51
58
  segments:
52
59
  - 0
53
60
  version: "0"
@@ -75,6 +82,7 @@ files:
75
82
  - lib/riot/gear/middleware.rb
76
83
  - lib/riot/gear/middleware/riotparty.rb
77
84
  - riot-gear.gemspec
85
+ - test/actions/get_test.rb
78
86
  - test/helpers/cookie_values_test.rb
79
87
  - test/helpers/json_path_test.rb
80
88
  - test/riotparty_proxy_methods_test.rb
@@ -90,27 +98,32 @@ rdoc_options:
90
98
  require_paths:
91
99
  - lib
92
100
  required_ruby_version: !ruby/object:Gem::Requirement
101
+ none: false
93
102
  requirements:
94
103
  - - ">="
95
104
  - !ruby/object:Gem::Version
105
+ hash: 3
96
106
  segments:
97
107
  - 0
98
108
  version: "0"
99
109
  required_rubygems_version: !ruby/object:Gem::Requirement
110
+ none: false
100
111
  requirements:
101
112
  - - ">="
102
113
  - !ruby/object:Gem::Version
114
+ hash: 3
103
115
  segments:
104
116
  - 0
105
117
  version: "0"
106
118
  requirements: []
107
119
 
108
120
  rubyforge_project:
109
- rubygems_version: 1.3.6
121
+ rubygems_version: 1.3.7
110
122
  signing_key:
111
123
  specification_version: 3
112
124
  summary: Riot + HTTParty smoke testing framework
113
125
  test_files:
126
+ - test/actions/get_test.rb
114
127
  - test/helpers/cookie_values_test.rb
115
128
  - test/helpers/json_path_test.rb
116
129
  - test/riotparty_proxy_methods_test.rb