cucumber-api-steps 0.9 → 0.10

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,4 +1,2 @@
1
- source "http://rubygems.org"
2
-
3
- # Specify your gem's dependencies in cuke-api-steps.gemspec
1
+ source :rubygems
4
2
  gemspec
data/Rakefile CHANGED
@@ -1,11 +1,7 @@
1
- require 'bundler'
2
- Bundler::GemHelper.install_tasks
3
-
4
- require 'bueller'
5
- Bueller::Tasks.new
1
+ require 'bundler/gem_tasks'
6
2
 
7
3
  require 'cucumber/rake/task'
8
4
 
9
5
  Cucumber::Rake::Task.new do |t|
10
6
  t.cucumber_opts = %w{--format pretty}
11
- end
7
+ end
@@ -7,14 +7,13 @@ Gem::Specification.new do |s|
7
7
  s.version = Cucumber::ApiSteps::VERSION
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Jay Zeschin"]
10
- s.email = ["jay.zeschin@factorylabs.com"]
10
+ s.email = ["jay.zeschin@modeset.com"]
11
11
  s.homepage = "http://github.com/jayzes/cucumber-api-steps"
12
12
  s.summary = %q{Cucumber steps to easily test REST-based XML and JSON APIs}
13
13
  s.description = %q{Cucumber steps to easily test REST-based XML and JSON APIs}
14
14
 
15
15
  s.add_dependency 'jsonpath', '>= 0.1.2'
16
16
  s.add_dependency 'cucumber', '>= 0.8.3'
17
- s.add_development_dependency 'bueller'
18
17
  s.add_development_dependency 'capybara'
19
18
 
20
19
  s.files = `git ls-files`.split("\n")
@@ -1,6 +1,6 @@
1
1
  require 'jsonpath'
2
2
 
3
- World(Rack::Test::Methods)
3
+ World(Rack::Test::Methods) if defined?(Rack)
4
4
 
5
5
  Given /^I send and accept (XML|JSON)$/ do |type|
6
6
  page.driver.header 'Accept', "application/#{type.downcase}"
@@ -33,7 +33,8 @@ When /^I send a (GET|POST|PUT|DELETE) request (?:for|to) "([^"]*)"(?: with the f
33
33
  end
34
34
 
35
35
  Then /^show me the response$/ do
36
- p page.driver.response
36
+ json_response = JSON.parse(page.driver.response)
37
+ puts JSON.pretty_generate(json_response)
37
38
  end
38
39
 
39
40
  Then /^the response status should be "([^"]*)"$/ do |status|
@@ -63,10 +64,10 @@ Then /^the JSON response should (not)?\s?have "([^"]*)" with the text "([^"]*)"$
63
64
  end
64
65
 
65
66
  Then /^the XML response should have "([^"]*)" with the text "([^"]*)"$/ do |xpath, text|
66
- parsed_response = Nokogiri::XML(last_response.body)
67
+ parsed_response = Nokogiri::XML(page.body)
67
68
  elements = parsed_response.xpath(xpath)
68
69
  if page.respond_to?(:should)
69
- elements.should_not be_empty, "could not find #{xpath} in:\n#{last_response.body}"
70
+ elements.should_not be_empty, "could not find #{xpath} in:\n#{page.body}"
70
71
  elements.find { |e| e.text == text }.should_not be_nil, "found elements but could not find #{text} in:\n#{elements.inspect}"
71
72
  else
72
73
  assert !elements.empty?, "could not find #{xpath} in:\n#{last_response.body}"
@@ -1,5 +1,5 @@
1
1
  module Cucumber
2
2
  module ApiSteps
3
- VERSION = "0.9"
3
+ VERSION = "0.10"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,92 +1,71 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: cucumber-api-steps
3
- version: !ruby/object:Gem::Version
4
- hash: 25
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.10'
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 9
9
- version: "0.9"
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Jay Zeschin
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-10-18 00:00:00 -06:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-06-19 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: jsonpath
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 31
29
- segments:
30
- - 0
31
- - 1
32
- - 2
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
33
21
  version: 0.1.2
34
22
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: cucumber
38
23
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.1.2
30
+ - !ruby/object:Gem::Dependency
31
+ name: cucumber
32
+ requirement: !ruby/object:Gem::Requirement
40
33
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 57
45
- segments:
46
- - 0
47
- - 8
48
- - 3
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
49
37
  version: 0.8.3
50
38
  type: :runtime
51
- version_requirements: *id002
52
- - !ruby/object:Gem::Dependency
53
- name: bueller
54
39
  prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
56
41
  none: false
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- hash: 3
61
- segments:
62
- - 0
63
- version: "0"
64
- type: :development
65
- version_requirements: *id003
66
- - !ruby/object:Gem::Dependency
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 0.8.3
46
+ - !ruby/object:Gem::Dependency
67
47
  name: capybara
68
- prerelease: false
69
- requirement: &id004 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
70
49
  none: false
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- hash: 3
75
- segments:
76
- - 0
77
- version: "0"
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
78
54
  type: :development
79
- version_requirements: *id004
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
80
62
  description: Cucumber steps to easily test REST-based XML and JSON APIs
81
- email:
82
- - jay.zeschin@factorylabs.com
63
+ email:
64
+ - jay.zeschin@modeset.com
83
65
  executables: []
84
-
85
66
  extensions: []
86
-
87
67
  extra_rdoc_files: []
88
-
89
- files:
68
+ files:
90
69
  - .gitignore
91
70
  - .rvmrc
92
71
  - Gemfile
@@ -96,39 +75,29 @@ files:
96
75
  - features/support/env.rb
97
76
  - lib/cucumber/api_steps.rb
98
77
  - lib/cucumber/api_steps/version.rb
99
- has_rdoc: true
100
78
  homepage: http://github.com/jayzes/cucumber-api-steps
101
79
  licenses: []
102
-
103
80
  post_install_message:
104
81
  rdoc_options: []
105
-
106
- require_paths:
82
+ require_paths:
107
83
  - lib
108
- required_ruby_version: !ruby/object:Gem::Requirement
84
+ required_ruby_version: !ruby/object:Gem::Requirement
109
85
  none: false
110
- requirements:
111
- - - ">="
112
- - !ruby/object:Gem::Version
113
- hash: 3
114
- segments:
115
- - 0
116
- version: "0"
117
- required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
91
  none: false
119
- requirements:
120
- - - ">="
121
- - !ruby/object:Gem::Version
122
- hash: 3
123
- segments:
124
- - 0
125
- version: "0"
92
+ requirements:
93
+ - - ! '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
126
96
  requirements: []
127
-
128
97
  rubyforge_project:
129
- rubygems_version: 1.6.2
98
+ rubygems_version: 1.8.23
130
99
  signing_key:
131
100
  specification_version: 3
132
101
  summary: Cucumber steps to easily test REST-based XML and JSON APIs
133
- test_files:
102
+ test_files:
134
103
  - features/support/env.rb