cucumber-nagios 0.7.6 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cucumber/nagios/steps.rb +1 -2
- data/lib/cucumber/nagios/steps/http_steps.rb +70 -0
- data/lib/cucumber/nagios/support/env.rb +2 -4
- data/lib/cucumber/nagios/support/webrat_logging_patches.rb +10 -0
- metadata +31 -10
- data/lib/cucumber/nagios/steps/result_steps.rb +0 -19
- data/lib/cucumber/nagios/steps/webrat_steps.rb +0 -40
@@ -5,6 +5,5 @@ require 'cucumber/nagios/steps/command_steps'
|
|
5
5
|
require 'cucumber/nagios/steps/dns_steps'
|
6
6
|
require 'cucumber/nagios/steps/file_steps'
|
7
7
|
require 'cucumber/nagios/steps/ping_steps'
|
8
|
-
require 'cucumber/nagios/steps/result_steps'
|
9
8
|
require 'cucumber/nagios/steps/ssh_steps'
|
10
|
-
require 'cucumber/nagios/steps/
|
9
|
+
require 'cucumber/nagios/steps/http_steps'
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# Setup
|
2
|
+
Given /^I am HTTP digest authenticated with the following credentials:$/ do |table|
|
3
|
+
attrs = table.hashes.first
|
4
|
+
username = attrs["username"]
|
5
|
+
password = attrs["password"]
|
6
|
+
|
7
|
+
basic_auth(username, password)
|
8
|
+
end
|
9
|
+
|
10
|
+
# Actions
|
11
|
+
When /^I go to "(.*)"$/ do |path|
|
12
|
+
visit path
|
13
|
+
end
|
14
|
+
|
15
|
+
When /^I press "(.*)"$/ do |button|
|
16
|
+
click_button(button)
|
17
|
+
end
|
18
|
+
|
19
|
+
When /^I follow "(.*)"$/ do |link|
|
20
|
+
click_link(link)
|
21
|
+
end
|
22
|
+
|
23
|
+
When /^I fill in "(.*)" with "(.*)"$/ do |field, value|
|
24
|
+
fill_in(field, :with => value)
|
25
|
+
end
|
26
|
+
|
27
|
+
When /^I select "(.*)" from "(.*)"$/ do |value, field|
|
28
|
+
select(value, :from => field)
|
29
|
+
end
|
30
|
+
|
31
|
+
When /^I check "(.*)"$/ do |field|
|
32
|
+
check(field)
|
33
|
+
end
|
34
|
+
|
35
|
+
When /^I uncheck "(.*)"$/ do |field|
|
36
|
+
uncheck(field)
|
37
|
+
end
|
38
|
+
|
39
|
+
When /^I choose "(.*)"$/ do |field|
|
40
|
+
choose(field)
|
41
|
+
end
|
42
|
+
|
43
|
+
When /^I submit the form named "(.*)"$/ do |name|
|
44
|
+
submit_form(name)
|
45
|
+
end
|
46
|
+
|
47
|
+
When /^I attach the file at "(.*)" to "(.*)" $/ do |path, field|
|
48
|
+
attach_file(field, path)
|
49
|
+
end
|
50
|
+
|
51
|
+
# Results
|
52
|
+
Then /^I should see "(.*)"$/ do |text|
|
53
|
+
response.body.to_s.should =~ /#{text}/m
|
54
|
+
end
|
55
|
+
|
56
|
+
Then /^I should not see "(.*)"$/ do |text|
|
57
|
+
response.body.to_s.should_not =~ /#{text}/m
|
58
|
+
end
|
59
|
+
|
60
|
+
Then /^I should see an? (\w+) message$/ do |message_type|
|
61
|
+
response.should have_xpath("//*[@class='#{message_type}']")
|
62
|
+
end
|
63
|
+
|
64
|
+
Then /^the (.*) ?request should succeed/ do |_|
|
65
|
+
success_code?.should be_true
|
66
|
+
end
|
67
|
+
|
68
|
+
Then /^the (.*) ?request should fail/ do |_|
|
69
|
+
success_code?.should be_false
|
70
|
+
end
|
@@ -1,8 +1,6 @@
|
|
1
1
|
require 'cucumber/nagios'
|
2
|
-
|
3
|
-
#For standalone execution
|
4
|
-
|
5
2
|
require 'webrat/adapters/mechanize'
|
3
|
+
require 'webrat_logging_patches'
|
6
4
|
|
7
5
|
class ResponseHelper
|
8
6
|
def response
|
@@ -13,4 +11,4 @@ end
|
|
13
11
|
World do
|
14
12
|
ResponseHelper.new
|
15
13
|
Webrat::Session.new(Webrat::MechanizeAdapter.new)
|
16
|
-
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-nagios
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 63
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
8
|
+
- 8
|
9
|
+
- 0
|
10
|
+
version: 0.8.0
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Lindsay Holmwood
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-12-30 00:00:00 +11:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: templater
|
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: 23
|
27
30
|
segments:
|
28
31
|
- 1
|
29
32
|
- 0
|
@@ -35,9 +38,11 @@ dependencies:
|
|
35
38
|
name: rake
|
36
39
|
prerelease: false
|
37
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
38
42
|
requirements:
|
39
43
|
- - ">="
|
40
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 57
|
41
46
|
segments:
|
42
47
|
- 0
|
43
48
|
- 8
|
@@ -49,9 +54,11 @@ dependencies:
|
|
49
54
|
name: bundler08
|
50
55
|
prerelease: false
|
51
56
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
52
58
|
requirements:
|
53
59
|
- - "="
|
54
60
|
- !ruby/object:Gem::Version
|
61
|
+
hash: 53
|
55
62
|
segments:
|
56
63
|
- 0
|
57
64
|
- 8
|
@@ -63,9 +70,11 @@ dependencies:
|
|
63
70
|
name: cucumber
|
64
71
|
prerelease: false
|
65
72
|
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
66
74
|
requirements:
|
67
75
|
- - ">="
|
68
76
|
- !ruby/object:Gem::Version
|
77
|
+
hash: 5
|
69
78
|
segments:
|
70
79
|
- 0
|
71
80
|
- 6
|
@@ -77,9 +86,11 @@ dependencies:
|
|
77
86
|
name: net-ssh
|
78
87
|
prerelease: false
|
79
88
|
requirement: &id005 !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
80
90
|
requirements:
|
81
91
|
- - "="
|
82
92
|
- !ruby/object:Gem::Version
|
93
|
+
hash: 43
|
83
94
|
segments:
|
84
95
|
- 2
|
85
96
|
- 0
|
@@ -91,9 +102,11 @@ dependencies:
|
|
91
102
|
name: webrat
|
92
103
|
prerelease: false
|
93
104
|
requirement: &id006 !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
94
106
|
requirements:
|
95
107
|
- - "="
|
96
108
|
- !ruby/object:Gem::Version
|
109
|
+
hash: 3
|
97
110
|
segments:
|
98
111
|
- 0
|
99
112
|
- 7
|
@@ -105,9 +118,11 @@ dependencies:
|
|
105
118
|
name: amqp
|
106
119
|
prerelease: false
|
107
120
|
requirement: &id007 !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
108
122
|
requirements:
|
109
123
|
- - "="
|
110
124
|
- !ruby/object:Gem::Version
|
125
|
+
hash: 9
|
111
126
|
segments:
|
112
127
|
- 0
|
113
128
|
- 6
|
@@ -119,9 +134,11 @@ dependencies:
|
|
119
134
|
name: rspec
|
120
135
|
prerelease: false
|
121
136
|
requirement: &id008 !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
122
138
|
requirements:
|
123
139
|
- - ">="
|
124
140
|
- !ruby/object:Gem::Version
|
141
|
+
hash: 27
|
125
142
|
segments:
|
126
143
|
- 1
|
127
144
|
- 3
|
@@ -129,7 +146,7 @@ dependencies:
|
|
129
146
|
version: 1.3.0
|
130
147
|
type: :runtime
|
131
148
|
version_requirements: *id008
|
132
|
-
description: cucumber-nagios
|
149
|
+
description: cucumber-nagios helps you write high-level behavioural tests for your web applications and Unix infrastructure that can be plugged into Nagios.
|
133
150
|
email: lindsay@holmwood.id.au
|
134
151
|
executables:
|
135
152
|
- cucumber-nagios-gen
|
@@ -146,12 +163,12 @@ files:
|
|
146
163
|
- lib/cucumber/nagios/steps/command_steps.rb
|
147
164
|
- lib/cucumber/nagios/steps/dns_steps.rb
|
148
165
|
- lib/cucumber/nagios/steps/file_steps.rb
|
166
|
+
- lib/cucumber/nagios/steps/http_steps.rb
|
149
167
|
- lib/cucumber/nagios/steps/ping_steps.rb
|
150
|
-
- lib/cucumber/nagios/steps/result_steps.rb
|
151
168
|
- lib/cucumber/nagios/steps/ssh_steps.rb
|
152
|
-
- lib/cucumber/nagios/steps/webrat_steps.rb
|
153
169
|
- lib/cucumber/nagios/steps.rb
|
154
170
|
- lib/cucumber/nagios/support/env.rb
|
171
|
+
- lib/cucumber/nagios/support/webrat_logging_patches.rb
|
155
172
|
- lib/cucumber/nagios/version.rb
|
156
173
|
- lib/cucumber/nagios.rb
|
157
174
|
- lib/cucumber-nagios.rb
|
@@ -168,7 +185,7 @@ files:
|
|
168
185
|
- lib/generators/project/.gitignore
|
169
186
|
- lib/generators/project/.bzrignore
|
170
187
|
has_rdoc: true
|
171
|
-
homepage: http://
|
188
|
+
homepage: http://cucumber-nagios.org/
|
172
189
|
licenses: []
|
173
190
|
|
174
191
|
post_install_message:
|
@@ -177,25 +194,29 @@ rdoc_options: []
|
|
177
194
|
require_paths:
|
178
195
|
- lib
|
179
196
|
required_ruby_version: !ruby/object:Gem::Requirement
|
197
|
+
none: false
|
180
198
|
requirements:
|
181
199
|
- - ">="
|
182
200
|
- !ruby/object:Gem::Version
|
201
|
+
hash: 3
|
183
202
|
segments:
|
184
203
|
- 0
|
185
204
|
version: "0"
|
186
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
|
+
none: false
|
187
207
|
requirements:
|
188
208
|
- - ">="
|
189
209
|
- !ruby/object:Gem::Version
|
210
|
+
hash: 3
|
190
211
|
segments:
|
191
212
|
- 0
|
192
213
|
version: "0"
|
193
214
|
requirements: []
|
194
215
|
|
195
216
|
rubyforge_project: cucumber-nagios
|
196
|
-
rubygems_version: 1.3.
|
217
|
+
rubygems_version: 1.3.7
|
197
218
|
signing_key:
|
198
219
|
specification_version: 3
|
199
|
-
summary:
|
220
|
+
summary: Systems testing plugin for Nagios using Cucumber/Webrat/Mechanize/net-ssh.
|
200
221
|
test_files: []
|
201
222
|
|
@@ -1,19 +0,0 @@
|
|
1
|
-
Then /^I should see "(.*)"$/ do |text|
|
2
|
-
response.body.to_s.should =~ /#{text}/m
|
3
|
-
end
|
4
|
-
|
5
|
-
Then /^I should not see "(.*)"$/ do |text|
|
6
|
-
response.body.to_s.should_not =~ /#{text}/m
|
7
|
-
end
|
8
|
-
|
9
|
-
Then /^I should see an? (\w+) message$/ do |message_type|
|
10
|
-
response.should have_xpath("//*[@class='#{message_type}']")
|
11
|
-
end
|
12
|
-
|
13
|
-
Then /^the (.*) ?request should succeed/ do |_|
|
14
|
-
success_code?.should be_true
|
15
|
-
end
|
16
|
-
|
17
|
-
Then /^the (.*) ?request should fail/ do |_|
|
18
|
-
success_code?.should be_false
|
19
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
When /^I go to (.*)$/ do |path|
|
2
|
-
visit path
|
3
|
-
end
|
4
|
-
|
5
|
-
When /^I press "(.*)"$/ do |button|
|
6
|
-
click_button(button)
|
7
|
-
end
|
8
|
-
|
9
|
-
When /^I follow "(.*)"$/ do |link|
|
10
|
-
click_link(link)
|
11
|
-
end
|
12
|
-
|
13
|
-
When /^I fill in "(.*)" with "(.*)"$/ do |field, value|
|
14
|
-
fill_in(field, :with => value)
|
15
|
-
end
|
16
|
-
|
17
|
-
When /^I select "(.*)" from "(.*)"$/ do |value, field|
|
18
|
-
select(value, :from => field)
|
19
|
-
end
|
20
|
-
|
21
|
-
When /^I check "(.*)"$/ do |field|
|
22
|
-
check(field)
|
23
|
-
end
|
24
|
-
|
25
|
-
When /^I uncheck "(.*)"$/ do |field|
|
26
|
-
uncheck(field)
|
27
|
-
end
|
28
|
-
|
29
|
-
When /^I choose "(.*)"$/ do |field|
|
30
|
-
choose(field)
|
31
|
-
end
|
32
|
-
|
33
|
-
When /^I submit the form named "(.*)"$/ do |name|
|
34
|
-
submit_form(name)
|
35
|
-
end
|
36
|
-
|
37
|
-
When /^I attach the file at "(.*)" to "(.*)" $/ do |path, field|
|
38
|
-
attach_file(field, path)
|
39
|
-
end
|
40
|
-
|