cucumber-nagios 0.8.11 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/AUTHORS +2 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +72 -0
- data/HACKING.md +73 -0
- data/README.md +4 -0
- data/Rakefile +29 -57
- data/bin/cucumber-nagios-gen +1 -1
- data/cucumber-nagios.gemspec +24 -106
- data/features/creating.feature +6 -0
- data/features/steps/creating_steps.rb +28 -2
- data/features/steps/installing_steps.rb +3 -1
- data/features/steps/using_steps.rb +14 -6
- data/lib/cucumber/nagios/version.rb +1 -1
- data/lib/generators/project/Gemfile +0 -10
- metadata +23 -18
- data/HACKING +0 -13
data/.gitignore
CHANGED
data/AUTHORS
CHANGED
@@ -14,5 +14,7 @@ Gareth Rushgrove <gareth@morethanseven.net>
|
|
14
14
|
Jesse Newland <jesse@jnewland.com>
|
15
15
|
Luiz Ozaki
|
16
16
|
Dean Wilson <dean.wilson@gmail.com>
|
17
|
+
Hedgehog <hedgehogshiatus@gmail.com>
|
18
|
+
Joseph Anthony Pasquale Holsten <joseph@josephholsten.com>
|
17
19
|
|
18
20
|
Portions of cucumber-nagios contain code originally contributed to Chef (http://github.com/opscode/chef)
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
cucumber-nagios (0.9.0)
|
5
|
+
amqp (= 0.6.7)
|
6
|
+
bundler (~> 1.0.7)
|
7
|
+
cucumber (>= 0.10.0)
|
8
|
+
mechanize (= 1.0.0)
|
9
|
+
net-ssh (~> 2.1.0)
|
10
|
+
rspec (>= 2.3.0)
|
11
|
+
templater (>= 1.0.0)
|
12
|
+
webrat (= 0.7.2)
|
13
|
+
|
14
|
+
GEM
|
15
|
+
remote: http://rubygems.org/
|
16
|
+
specs:
|
17
|
+
amqp (0.6.7)
|
18
|
+
eventmachine (>= 0.12.4)
|
19
|
+
builder (3.0.0)
|
20
|
+
cucumber (0.10.0)
|
21
|
+
builder (>= 2.1.2)
|
22
|
+
diff-lcs (~> 1.1.2)
|
23
|
+
gherkin (~> 2.3.2)
|
24
|
+
json (~> 1.4.6)
|
25
|
+
term-ansicolor (~> 1.0.5)
|
26
|
+
diff-lcs (1.1.2)
|
27
|
+
eventmachine (0.12.10)
|
28
|
+
extlib (0.9.15)
|
29
|
+
gherkin (2.3.3)
|
30
|
+
json (~> 1.4.6)
|
31
|
+
highline (1.6.1)
|
32
|
+
json (1.4.6)
|
33
|
+
mechanize (1.0.0)
|
34
|
+
nokogiri (>= 1.2.1)
|
35
|
+
net-ssh (2.1.3)
|
36
|
+
nokogiri (1.4.4)
|
37
|
+
rack (1.2.1)
|
38
|
+
rack-test (0.5.7)
|
39
|
+
rack (>= 1.0)
|
40
|
+
rake (0.8.7)
|
41
|
+
rspec (2.5.0)
|
42
|
+
rspec-core (~> 2.5.0)
|
43
|
+
rspec-expectations (~> 2.5.0)
|
44
|
+
rspec-mocks (~> 2.5.0)
|
45
|
+
rspec-core (2.5.1)
|
46
|
+
rspec-expectations (2.5.0)
|
47
|
+
diff-lcs (~> 1.1.2)
|
48
|
+
rspec-mocks (2.5.0)
|
49
|
+
templater (1.0.0)
|
50
|
+
diff-lcs (>= 1.1.2)
|
51
|
+
extlib (>= 0.9.5)
|
52
|
+
highline (>= 1.4.0)
|
53
|
+
term-ansicolor (1.0.5)
|
54
|
+
webrat (0.7.2)
|
55
|
+
nokogiri (>= 1.2.0)
|
56
|
+
rack (>= 1.0)
|
57
|
+
rack-test (>= 0.5.3)
|
58
|
+
|
59
|
+
PLATFORMS
|
60
|
+
ruby
|
61
|
+
|
62
|
+
DEPENDENCIES
|
63
|
+
amqp (= 0.6.7)
|
64
|
+
bundler (~> 1.0.7)
|
65
|
+
cucumber (>= 0.10.0)
|
66
|
+
cucumber-nagios!
|
67
|
+
mechanize (= 1.0.0)
|
68
|
+
net-ssh (~> 2.1.0)
|
69
|
+
rake (>= 0.8.3)
|
70
|
+
rspec (>= 2.3.0)
|
71
|
+
templater (>= 1.0.0)
|
72
|
+
webrat (= 0.7.2)
|
data/HACKING.md
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
Hacking
|
2
|
+
=======
|
3
|
+
|
4
|
+
Found something wrong? Got a great idea? You too can make cucumber-nagios
|
5
|
+
better by submitting a issue or patch.
|
6
|
+
|
7
|
+
Reporting issues
|
8
|
+
================
|
9
|
+
|
10
|
+
First, head over to our [issue
|
11
|
+
tracking](https://github.com/auxesis/cucumber-nagios/issues) and see if other
|
12
|
+
people want the same thing. If you don't see anything similar, create an issue
|
13
|
+
to let us know what's on your mind. As you might expect, we use cucumber to
|
14
|
+
write tests, so if you can describe your idea using Givens, Whens, and Thens,
|
15
|
+
that'll make fixing it even easier.
|
16
|
+
|
17
|
+
Submitting patches
|
18
|
+
==================
|
19
|
+
|
20
|
+
If you're feeling ambitious, creating a feature branch that solves your issue
|
21
|
+
is even better. Fork the [project](https://github.com/auxesis/cucumber-nagios),
|
22
|
+
and check out your fork (assuming a GitHub username of ken):
|
23
|
+
|
24
|
+
$ git clone https://github.com/ken/cucumber-nagios.git
|
25
|
+
|
26
|
+
Setup your environment and make sure the tests pass:
|
27
|
+
|
28
|
+
$ cd cucumber-nagios
|
29
|
+
$ bundle install
|
30
|
+
$ rake
|
31
|
+
|
32
|
+
Start a branch, apply your changes, make sure the tests still pass, commit, and
|
33
|
+
push to GitHub:
|
34
|
+
|
35
|
+
$ git checkout -b my_feature_branch
|
36
|
+
[ edit files ]
|
37
|
+
$ rake
|
38
|
+
$ git commit -m "Added new awesome features. Fixes github issue #1234"
|
39
|
+
$ git push origin my_feature_branch
|
40
|
+
|
41
|
+
Then send us a pull request from your fork's page at GitHub.
|
42
|
+
|
43
|
+
Releasing a gem
|
44
|
+
===============
|
45
|
+
|
46
|
+
Releasing a gem is easy, but everyone forgets the exact steps.
|
47
|
+
|
48
|
+
1. Check AUTHORS, LICENSE, TODO, README.md and lib/generators/project/README to
|
49
|
+
make sure they're still accurate. Everyone hates when the docs are out of
|
50
|
+
date! :-)
|
51
|
+
|
52
|
+
2. Review MANIFEST to make sure gem files, all the gem files, and nothing but
|
53
|
+
the gem files are going into the gem. Running `git status` and `rake
|
54
|
+
check_manifest` will help you notice anything out of place.
|
55
|
+
|
56
|
+
3. Update Cucumber::Nagios::VERSION in lib/cucumber/nagios/version.rb. Check
|
57
|
+
http://semver.org if you aren't sure whether to use a prerelease, increment the
|
58
|
+
patch, minor or major version.
|
59
|
+
|
60
|
+
4. Remove any stray files. Every file in `git status` should be in "Changes to
|
61
|
+
be committed".
|
62
|
+
|
63
|
+
3. Run the tests with `rake`.
|
64
|
+
|
65
|
+
4. Commit your changes.
|
66
|
+
|
67
|
+
5. Build the gem with `rake build`.
|
68
|
+
|
69
|
+
6. Install the gem locally with `rake install`. Check that it seems to work.
|
70
|
+
|
71
|
+
7. Tag and push to RubyGems with `rake release`.
|
72
|
+
|
73
|
+
8. Push to GitHub with `git push origin`
|
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -1,74 +1,30 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require 'rubygems'
|
4
|
-
require 'rake'
|
5
|
-
require 'lib/cucumber/nagios/version'
|
6
|
-
|
7
3
|
begin
|
8
|
-
require '
|
9
|
-
|
10
|
-
gem.name = "cucumber-nagios"
|
11
|
-
gem.summary = "Systems testing plugin for Nagios using Cucumber/Webrat/Mechanize/net-ssh."
|
12
|
-
gem.description = "cucumber-nagios helps you write high-level behavioural tests for your web applications and Unix infrastructure that can be plugged into Nagios."
|
13
|
-
gem.email = "lindsay@holmwood.id.au"
|
14
|
-
gem.homepage = "http://cucumber-nagios.org/"
|
15
|
-
gem.authors = ["Lindsay Holmwood"]
|
16
|
-
gem.has_rdoc = false
|
17
|
-
gem.version = Cucumber::Nagios::VERSION
|
18
|
-
|
19
|
-
gem.add_dependency('cucumber', '>= 0.10.0')
|
20
|
-
gem.add_dependency('rspec', '>= 2.3.0')
|
21
|
-
gem.add_dependency('webrat', '= 0.7.2')
|
22
|
-
gem.add_dependency('mechanize', '= 1.0.0')
|
23
|
-
gem.add_dependency('templater', '>= 1.0.0')
|
24
|
-
gem.add_dependency('net-ssh', '= 2.0.18')
|
25
|
-
gem.add_dependency('amqp', '= 0.6.7')
|
26
|
-
gem.add_dependency('bundler', '= 1.0.7')
|
27
|
-
|
28
|
-
gem.add_development_dependency('rake', '>= 0.8.3')
|
29
|
-
|
30
|
-
gem.bindir = "bin"
|
31
|
-
gem.executables = %w(cucumber-nagios-gen cucumber-nagios)
|
32
|
-
end
|
33
|
-
Jeweler::GemcutterTasks.new
|
4
|
+
require 'bundler'
|
5
|
+
Bundler::GemHelper.install_tasks
|
34
6
|
rescue LoadError
|
35
|
-
puts "
|
36
|
-
end
|
37
|
-
|
38
|
-
require 'rake/testtask'
|
39
|
-
Rake::TestTask.new(:test) do |test|
|
40
|
-
test.libs << 'lib' << 'test'
|
41
|
-
test.pattern = 'test/**/test_*.rb'
|
42
|
-
test.verbose = true
|
7
|
+
puts "Bundler not available. Install it with: gem install bundler"
|
43
8
|
end
|
44
9
|
|
45
|
-
begin
|
46
|
-
require 'rcov/rcovtask'
|
47
|
-
Rcov::RcovTask.new do |test|
|
48
|
-
test.libs << 'test'
|
49
|
-
test.pattern = 'test/**/test_*.rb'
|
50
|
-
test.verbose = true
|
51
|
-
end
|
52
|
-
rescue LoadError
|
53
|
-
task :rcov do
|
54
|
-
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
task :test => :check_dependencies
|
59
|
-
|
60
10
|
begin
|
61
11
|
require 'cucumber/rake/task'
|
62
|
-
Cucumber::Rake::Task.new(:features)
|
63
|
-
|
64
|
-
task :features => :check_dependencies
|
12
|
+
#Cucumber::Rake::Task.new(:features)
|
65
13
|
rescue LoadError
|
66
14
|
task :features do
|
67
15
|
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
|
68
16
|
end
|
69
17
|
end
|
70
18
|
|
71
|
-
task :default => :
|
19
|
+
task :default => :features
|
20
|
+
|
21
|
+
desc "Run Cucumber features"
|
22
|
+
task :features do
|
23
|
+
puts "The bundled Cucumber Rake task is broken with Bundler."
|
24
|
+
puts "Invoking Cucumber manually."
|
25
|
+
puts
|
26
|
+
system("cucumber")
|
27
|
+
end
|
72
28
|
|
73
29
|
require 'rake/rdoctask'
|
74
30
|
Rake::RDocTask.new do |rdoc|
|
@@ -79,3 +35,19 @@ Rake::RDocTask.new do |rdoc|
|
|
79
35
|
rdoc.rdoc_files.include('README*')
|
80
36
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
81
37
|
end
|
38
|
+
|
39
|
+
|
40
|
+
require "rake/clean"
|
41
|
+
file 'MANIFEST.tmp' do
|
42
|
+
# generate manifest from everything checked into git
|
43
|
+
# this allows us to ignore things using .gitignore
|
44
|
+
sh %{git ls-files > MANIFEST.tmp}
|
45
|
+
end
|
46
|
+
CLEAN << 'MANIFEST.tmp'
|
47
|
+
|
48
|
+
desc "Check the manifest against current files"
|
49
|
+
task :check_manifest => [:clean, 'MANIFEST', 'MANIFEST.tmp'] do
|
50
|
+
puts `diff -du MANIFEST MANIFEST.tmp`
|
51
|
+
end
|
52
|
+
|
53
|
+
CLEAN << '*.gem'
|
data/bin/cucumber-nagios-gen
CHANGED
@@ -50,7 +50,7 @@ module CucumberNagiosGenerators
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def git_init
|
53
|
-
if system("which git > /dev/null 2>&1")
|
53
|
+
if system("which git > /dev/null 2>&1") && File.directory?(destination_root)
|
54
54
|
Dir.chdir(destination_root) do
|
55
55
|
git_directory = Pathname.new(destination_root).join('.git')
|
56
56
|
if not git_directory.directory?
|
data/cucumber-nagios.gemspec
CHANGED
@@ -1,113 +1,31 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require 'cucumber/nagios/version'
|
5
4
|
|
6
5
|
Gem::Specification.new do |s|
|
7
|
-
s.name
|
8
|
-
s.
|
6
|
+
s.name = "cucumber-nagios"
|
7
|
+
s.platform = Gem::Platform::RUBY
|
8
|
+
s.version = Cucumber::Nagios::VERSION
|
9
|
+
s.summary = "Systems testing plugin for Nagios using Cucumber."
|
10
|
+
s.description = "cucumber-nagios helps you write behavioural tests for your systems and infrastructure, that can be plugged into Nagios."
|
11
|
+
s.homepage = "http://cucumber-nagios.org/"
|
9
12
|
|
10
|
-
s.
|
11
|
-
s.
|
12
|
-
s.date = %q{2011-03-06}
|
13
|
-
s.description = %q{cucumber-nagios helps you write high-level behavioural tests for your web applications and Unix infrastructure that can be plugged into Nagios.}
|
14
|
-
s.email = %q{lindsay@holmwood.id.au}
|
15
|
-
s.executables = ["cucumber-nagios-gen", "cucumber-nagios"]
|
16
|
-
s.extra_rdoc_files = [
|
17
|
-
"LICENSE",
|
18
|
-
"README.md",
|
19
|
-
"TODO"
|
20
|
-
]
|
21
|
-
s.files = [
|
22
|
-
".gitignore",
|
23
|
-
"AUTHORS",
|
24
|
-
"HACKING",
|
25
|
-
"LICENSE",
|
26
|
-
"README.md",
|
27
|
-
"Rakefile",
|
28
|
-
"TODO",
|
29
|
-
"bin/cucumber-nagios",
|
30
|
-
"bin/cucumber-nagios-gen",
|
31
|
-
"cucumber-nagios.gemspec",
|
32
|
-
"features/commands.feature",
|
33
|
-
"features/creating.feature",
|
34
|
-
"features/files.feature",
|
35
|
-
"features/http_steps.feature",
|
36
|
-
"features/installing.feature",
|
37
|
-
"features/steps/creating_steps.rb",
|
38
|
-
"features/steps/installing_steps.rb",
|
39
|
-
"features/steps/using_steps.rb",
|
40
|
-
"features/support/env.rb",
|
41
|
-
"features/support/silent_system.rb",
|
42
|
-
"features/support/webrat_logging_patches.rb",
|
43
|
-
"features/using.feature",
|
44
|
-
"lib/cucumber-nagios.rb",
|
45
|
-
"lib/cucumber/formatter/nagios.rb",
|
46
|
-
"lib/cucumber/nagios.rb",
|
47
|
-
"lib/cucumber/nagios/command.rb",
|
48
|
-
"lib/cucumber/nagios/steps.rb",
|
49
|
-
"lib/cucumber/nagios/steps/amqp_steps.rb",
|
50
|
-
"lib/cucumber/nagios/steps/benchmark_steps.rb",
|
51
|
-
"lib/cucumber/nagios/steps/command_steps.rb",
|
52
|
-
"lib/cucumber/nagios/steps/dns_steps.rb",
|
53
|
-
"lib/cucumber/nagios/steps/file_steps.rb",
|
54
|
-
"lib/cucumber/nagios/steps/http_header_steps.rb",
|
55
|
-
"lib/cucumber/nagios/steps/http_steps.rb",
|
56
|
-
"lib/cucumber/nagios/steps/ping_steps.rb",
|
57
|
-
"lib/cucumber/nagios/steps/ssh_steps.rb",
|
58
|
-
"lib/cucumber/nagios/support/env.rb",
|
59
|
-
"lib/cucumber/nagios/support/webrat_logging_patches.rb",
|
60
|
-
"lib/cucumber/nagios/version.rb",
|
61
|
-
"lib/generators/feature/%feature_name%.feature",
|
62
|
-
"lib/generators/feature/%feature_name%_steps.rb",
|
63
|
-
"lib/generators/project/.bzrignore",
|
64
|
-
"lib/generators/project/.gitignore",
|
65
|
-
"lib/generators/project/Gemfile",
|
66
|
-
"lib/generators/project/README",
|
67
|
-
"man/cucumber-nagios.1.ronn"
|
68
|
-
]
|
69
|
-
s.has_rdoc = false
|
70
|
-
s.homepage = %q{http://cucumber-nagios.org/}
|
71
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
72
|
-
s.require_paths = ["lib"]
|
73
|
-
s.rubygems_version = %q{1.3.7}
|
74
|
-
s.summary = %q{Systems testing plugin for Nagios using Cucumber/Webrat/Mechanize/net-ssh.}
|
13
|
+
s.authors = ["Lindsay Holmwood"]
|
14
|
+
s.email = ["lindsay@holmwood.id.au"]
|
75
15
|
|
76
|
-
|
77
|
-
|
78
|
-
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.files = `git ls-files`.split(/\r?\n\r?/)
|
18
|
+
s.executables = s.files.grep(/^bin/) { |f| File.basename(f) }
|
19
|
+
s.default_executable = "cucumber-nagios"
|
20
|
+
s.extra_rdoc_files = s.files.grep(/^[A-Z]+(\.md)*$/)
|
79
21
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
s.add_development_dependency(%q<rake>, [">= 0.8.3"])
|
90
|
-
else
|
91
|
-
s.add_dependency(%q<cucumber>, [">= 0.10.0"])
|
92
|
-
s.add_dependency(%q<rspec>, [">= 2.3.0"])
|
93
|
-
s.add_dependency(%q<webrat>, ["= 0.7.2"])
|
94
|
-
s.add_dependency(%q<mechanize>, ["= 1.0.0"])
|
95
|
-
s.add_dependency(%q<templater>, [">= 1.0.0"])
|
96
|
-
s.add_dependency(%q<net-ssh>, ["= 2.0.18"])
|
97
|
-
s.add_dependency(%q<amqp>, ["= 0.6.7"])
|
98
|
-
s.add_dependency(%q<bundler>, ["= 1.0.7"])
|
99
|
-
s.add_dependency(%q<rake>, [">= 0.8.3"])
|
100
|
-
end
|
101
|
-
else
|
102
|
-
s.add_dependency(%q<cucumber>, [">= 0.10.0"])
|
103
|
-
s.add_dependency(%q<rspec>, [">= 2.3.0"])
|
104
|
-
s.add_dependency(%q<webrat>, ["= 0.7.2"])
|
105
|
-
s.add_dependency(%q<mechanize>, ["= 1.0.0"])
|
106
|
-
s.add_dependency(%q<templater>, [">= 1.0.0"])
|
107
|
-
s.add_dependency(%q<net-ssh>, ["= 2.0.18"])
|
108
|
-
s.add_dependency(%q<amqp>, ["= 0.6.7"])
|
109
|
-
s.add_dependency(%q<bundler>, ["= 1.0.7"])
|
110
|
-
s.add_dependency(%q<rake>, [">= 0.8.3"])
|
111
|
-
end
|
22
|
+
s.add_runtime_dependency "cucumber", ">= 0.10.0"
|
23
|
+
s.add_runtime_dependency "rspec", ">= 2.3.0"
|
24
|
+
s.add_runtime_dependency "webrat", "= 0.7.2"
|
25
|
+
s.add_runtime_dependency "mechanize", "= 1.0.0"
|
26
|
+
s.add_runtime_dependency "templater", ">= 1.0.0"
|
27
|
+
s.add_runtime_dependency "net-ssh", "~> 2.1.0"
|
28
|
+
s.add_runtime_dependency "amqp", "= 0.6.7"
|
29
|
+
s.add_runtime_dependency "bundler", "~> 1.0.7"
|
30
|
+
s.add_development_dependency "rake", ">= 0.8.3"
|
112
31
|
end
|
113
|
-
|
data/features/creating.feature
CHANGED
@@ -10,3 +10,9 @@ Feature: Creating new project
|
|
10
10
|
And I freeze in dependencies
|
11
11
|
Then a Gemfile lock should be created
|
12
12
|
|
13
|
+
@create
|
14
|
+
Scenario: Pretend to create a project
|
15
|
+
Given cucumber-nagios is installed
|
16
|
+
When I pretend to create a new project called "greatest-website-tests"
|
17
|
+
Then I do not freeze in dependencies
|
18
|
+
And a Gemfile lock should not be created
|
@@ -9,12 +9,34 @@ When /^I create a new project called "([^\"]*)"$/ do |project_name|
|
|
9
9
|
@project_name = project_name
|
10
10
|
FileUtils.rm_rf("/tmp/#{@project_name}")
|
11
11
|
|
12
|
-
|
12
|
+
Dir.chdir("/tmp") do
|
13
|
+
silent_system("cucumber-nagios-gen project #{@project_name}").should be_true
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
When /^I pretend to create a new project called "([^\"]*)"$/ do |project_name|
|
18
|
+
@project_name = project_name
|
19
|
+
FileUtils.rm_rf("/tmp/#{@project_name}") if File.directory?("/tmp/#{@project_name}")
|
20
|
+
|
21
|
+
Dir.chdir("/tmp") do
|
22
|
+
silent_system("cucumber-nagios-gen project --pretend #{@project_name}").should be_true
|
23
|
+
end
|
13
24
|
end
|
14
25
|
|
15
26
|
When /^I freeze in dependencies$/ do
|
16
27
|
@project_name.should_not be_nil
|
17
|
-
|
28
|
+
Dir.chdir("/tmp/#{@project_name}") do
|
29
|
+
silent_system("bundle install --local").should be_true
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
Then /^I do not freeze in dependencies$/ do
|
34
|
+
@project_name.should_not be_nil
|
35
|
+
lambda do
|
36
|
+
Dir.chdir("/tmp/#{@project_name}") do
|
37
|
+
$stderr.puts "This should not run"
|
38
|
+
end
|
39
|
+
end.should raise_error(Errno::ENOENT)
|
18
40
|
end
|
19
41
|
|
20
42
|
Then /^a Gemfile lock should be created$/ do
|
@@ -22,4 +44,8 @@ Then /^a Gemfile lock should be created$/ do
|
|
22
44
|
File.exists?("/tmp/#{@project_name}/Gemfile.lock").should be_true
|
23
45
|
end
|
24
46
|
|
47
|
+
Then /^a Gemfile lock should not be created$/ do
|
48
|
+
@project_name.should_not be_nil
|
49
|
+
File.exists?("/tmp/#{@project_name}/Gemfile.lock").should be_false
|
50
|
+
end
|
25
51
|
|
@@ -23,7 +23,9 @@ Then /^I can generate a new project$/ do
|
|
23
23
|
testproj = "testproj-#{Time.now.to_i}"
|
24
24
|
FileUtils.rm_rf("/tmp/#{testproj}")
|
25
25
|
|
26
|
-
|
26
|
+
Dir.chdir("/tmp") do
|
27
|
+
silent_system("cucumber-nagios-gen project #{testproj}").should be_true
|
28
|
+
end
|
27
29
|
File.exists?("/tmp/#{testproj}").should be_true
|
28
30
|
end
|
29
31
|
|
@@ -7,7 +7,9 @@ Given /^a project called "([^\"]*)" is created and frozen$/ do |project_name|
|
|
7
7
|
end
|
8
8
|
|
9
9
|
When /^I generate a new feature called "([^\"]*)" for "([^\"]*)"$/ do |feature, site|
|
10
|
-
|
10
|
+
Dir.chdir("/tmp/#{@project_name}") do
|
11
|
+
silent_system("cucumber-nagios-gen feature #{site} #{feature}")
|
12
|
+
end
|
11
13
|
end
|
12
14
|
|
13
15
|
Then /^a feature file should exist for "([^\"]*)" on "([^\"]*)"$/ do |feature, site|
|
@@ -15,11 +17,15 @@ Then /^a feature file should exist for "([^\"]*)" on "([^\"]*)"$/ do |feature, s
|
|
15
17
|
end
|
16
18
|
|
17
19
|
Then /^the "([^\"]*)" feature on "([^\"]*)" should exit cleanly$/ do |feature, site|
|
18
|
-
|
20
|
+
Dir.chdir("/tmp/#{@project_name}") do
|
21
|
+
silent_system("cucumber-nagios features/#{site}/#{feature}.feature").should be_true
|
22
|
+
end
|
19
23
|
end
|
20
24
|
|
21
25
|
Then /^the "([^\"]*)" feature on "([^\"]*)" should not exit cleanly$/ do |feature, site|
|
22
|
-
|
26
|
+
Dir.chdir("/tmp/#{@project_name}") do
|
27
|
+
silent_system("cucumber-nagios features/#{site}/#{feature}.feature").should be_false
|
28
|
+
end
|
23
29
|
end
|
24
30
|
|
25
31
|
When /^the "([^\"]*)" feature on "([^\"]*)" checks for something preposterous$/ do |feature, site|
|
@@ -35,7 +41,9 @@ Then /^"([^"]*)" in the "([^"]*)" project should not exist$/ do |file, project_n
|
|
35
41
|
end
|
36
42
|
|
37
43
|
Then /^the "([^"]*)" feature on "([^"]*)" should produce multiline output$/ do |feature, site|
|
38
|
-
|
39
|
-
|
40
|
-
|
44
|
+
Dir.chdir("/tmp/#{@project_name}") do
|
45
|
+
command = "cucumber-nagios features/#{site}/#{feature}.feature"
|
46
|
+
@output = `#{command}`
|
47
|
+
@output.split("\n").size.should > 1
|
48
|
+
end
|
41
49
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-nagios
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 59
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 9
|
9
|
+
- 0
|
10
|
+
version: 0.9.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Lindsay Holmwood
|
@@ -16,7 +16,7 @@ bindir: bin
|
|
16
16
|
cert_chain: []
|
17
17
|
|
18
18
|
date: 2011-03-06 00:00:00 +11:00
|
19
|
-
default_executable:
|
19
|
+
default_executable: cucumber-nagios
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: cucumber
|
@@ -104,14 +104,14 @@ dependencies:
|
|
104
104
|
requirement: &id006 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
|
-
- -
|
107
|
+
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
hash:
|
109
|
+
hash: 11
|
110
110
|
segments:
|
111
111
|
- 2
|
112
|
+
- 1
|
112
113
|
- 0
|
113
|
-
|
114
|
-
version: 2.0.18
|
114
|
+
version: 2.1.0
|
115
115
|
type: :runtime
|
116
116
|
version_requirements: *id006
|
117
117
|
- !ruby/object:Gem::Dependency
|
@@ -136,7 +136,7 @@ dependencies:
|
|
136
136
|
requirement: &id008 !ruby/object:Gem::Requirement
|
137
137
|
none: false
|
138
138
|
requirements:
|
139
|
-
- -
|
139
|
+
- - ~>
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
hash: 25
|
142
142
|
segments:
|
@@ -162,21 +162,26 @@ dependencies:
|
|
162
162
|
version: 0.8.3
|
163
163
|
type: :development
|
164
164
|
version_requirements: *id009
|
165
|
-
description: cucumber-nagios helps you write
|
166
|
-
email:
|
165
|
+
description: cucumber-nagios helps you write behavioural tests for your systems and infrastructure, that can be plugged into Nagios.
|
166
|
+
email:
|
167
|
+
- lindsay@holmwood.id.au
|
167
168
|
executables:
|
168
|
-
- cucumber-nagios-gen
|
169
169
|
- cucumber-nagios
|
170
|
+
- cucumber-nagios-gen
|
170
171
|
extensions: []
|
171
172
|
|
172
173
|
extra_rdoc_files:
|
174
|
+
- AUTHORS
|
175
|
+
- HACKING.md
|
173
176
|
- LICENSE
|
174
177
|
- README.md
|
175
178
|
- TODO
|
176
179
|
files:
|
177
180
|
- .gitignore
|
178
181
|
- AUTHORS
|
179
|
-
-
|
182
|
+
- Gemfile
|
183
|
+
- Gemfile.lock
|
184
|
+
- HACKING.md
|
180
185
|
- LICENSE
|
181
186
|
- README.md
|
182
187
|
- Rakefile
|
@@ -220,13 +225,13 @@ files:
|
|
220
225
|
- lib/generators/project/Gemfile
|
221
226
|
- lib/generators/project/README
|
222
227
|
- man/cucumber-nagios.1.ronn
|
223
|
-
has_rdoc:
|
228
|
+
has_rdoc: true
|
224
229
|
homepage: http://cucumber-nagios.org/
|
225
230
|
licenses: []
|
226
231
|
|
227
232
|
post_install_message:
|
228
|
-
rdoc_options:
|
229
|
-
|
233
|
+
rdoc_options: []
|
234
|
+
|
230
235
|
require_paths:
|
231
236
|
- lib
|
232
237
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -253,6 +258,6 @@ rubyforge_project:
|
|
253
258
|
rubygems_version: 1.3.7
|
254
259
|
signing_key:
|
255
260
|
specification_version: 3
|
256
|
-
summary: Systems testing plugin for Nagios using Cucumber
|
261
|
+
summary: Systems testing plugin for Nagios using Cucumber.
|
257
262
|
test_files: []
|
258
263
|
|
data/HACKING
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
Running tests
|
2
|
-
=============
|
3
|
-
|
4
|
-
Make sure you have the rspec and Cucumber gems installed.
|
5
|
-
|
6
|
-
Cucumber features live under features/. They cover the basics of installing,
|
7
|
-
creating projects, and running cucumber-nagios.
|
8
|
-
|
9
|
-
Run the features with:
|
10
|
-
|
11
|
-
$ rake cucumber
|
12
|
-
|
13
|
-
They can take a while as they freeze in the dependencies a bunch of times.
|