Skip to content

Commit

Permalink
remove generated bin/cucumber-nagios and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
josephholsten committed Feb 27, 2011
1 parent e4506cf commit f52c3dc
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 46 deletions.
1 change: 0 additions & 1 deletion MANIFEST
Expand Up @@ -47,5 +47,4 @@ lib/generators/project/.bzrignore
lib/generators/project/.gitignore
lib/generators/project/Gemfile
lib/generators/project/README
lib/generators/project/bin/cucumber-nagios
man/cucumber-nagios.1.ronn
1 change: 1 addition & 0 deletions Rakefile
Expand Up @@ -43,3 +43,4 @@ task :check_manifest => [:clean, 'MANIFEST', 'MANIFEST.tmp'] do
end

CLEAN << '*.gem'
CLEAN << '.rake_tasks'
3 changes: 2 additions & 1 deletion features/installing.feature
Expand Up @@ -7,6 +7,7 @@ Feature: Installation
Scenario: Installing the gem
When I build the gem
And I install the latest gem
Then I should have cucumber-nagios-gen on my path
Then I should have "cucumber-nagios-gen" on my path
And I should have "cucumber-nagios" on my path
And I can generate a new project

3 changes: 2 additions & 1 deletion features/steps/creating_steps.rb
@@ -1,7 +1,8 @@
Given /^cucumber\-nagios is installed$/ do
When 'I build the gem'
And 'I install the latest gem'
Then 'I should have cucumber-nagios-gen on my path'
Then 'I should have "cucumber-nagios-gen" on my path'
And 'I should have "cucumber-nagios" on my path'
end

When /^I create a new project called "([^\"]*)"$/ do |project_name|
Expand Down
6 changes: 3 additions & 3 deletions features/steps/installing_steps.rb
Expand Up @@ -3,7 +3,7 @@
rakefile = project_root.join('Rakefile')
File.exist?(rakefile).should be_true

silent_system("rake -f #{rakefile} build").should be_true
system("rake -f #{rakefile} build").should be_true
end

When /^I install the latest gem$/ do
Expand All @@ -15,8 +15,8 @@
silent_system("gem install --local #{latest}").should be_true
end

Then /^I should have cucumber\-nagios\-gen on my path$/ do
silent_system("which cucumber-nagios-gen").should be_true
Then /^I should have "([^"]*)" on my path$/ do |file|
silent_system("which #{file}").should be_true
end

Then /^I can generate a new project$/ do
Expand Down
6 changes: 3 additions & 3 deletions features/steps/using_steps.rb
Expand Up @@ -15,11 +15,11 @@
end

Then /^the "([^\"]*)" feature on "([^\"]*)" should exit cleanly$/ do |feature, site|
silent_system("cd /tmp/#{@project_name} ; bin/cucumber-nagios features/#{site}/#{feature}.feature").should be_true
silent_system("cd /tmp/#{@project_name} ; cucumber-nagios features/#{site}/#{feature}.feature").should be_true
end

Then /^the "([^\"]*)" feature on "([^\"]*)" should not exit cleanly$/ do |feature, site|
silent_system("cd /tmp/#{@project_name} ; bin/cucumber-nagios features/#{site}/#{feature}.feature").should be_false
silent_system("cd /tmp/#{@project_name} ; cucumber-nagios features/#{site}/#{feature}.feature").should be_false
end

When /^the "([^\"]*)" feature on "([^\"]*)" checks for something preposterous$/ do |feature, site|
Expand All @@ -35,7 +35,7 @@
end

Then /^the "([^"]*)" feature on "([^"]*)" should produce multiline output$/ do |feature, site|
command = "cd /tmp/#{@project_name} ; bin/cucumber-nagios features/#{site}/#{feature}.feature"
command = "cd /tmp/#{@project_name} ; cucumber-nagios features/#{site}/#{feature}.feature"
@output = `#{command}`
@output.split("\n").size.should > 1
end
4 changes: 2 additions & 2 deletions lib/generators/project/README
Expand Up @@ -107,11 +107,11 @@ Running

Invoke the Cucumber feature with the cucumber-nagios script:

bin/cucumber-nagios features/smh.com.au/smh.feature
cucumber-nagios features/smh.com.au/smh.feature

cucumber-nagios can be run from anywhere:

/path/to/bin/cucumber-nagios /path/to/features/smh/smh.feature
cucumber-nagios /path/to/features/smh/smh.feature

It should return a standard Nagios-formatted response string:

Expand Down
35 changes: 0 additions & 35 deletions lib/generators/project/bin/cucumber-nagios

This file was deleted.

0 comments on commit f52c3dc

Please sign in to comment.