Created
February 4, 2011 08:34
-
-
Save auxesis/810878 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| When /^I build the gem$/ do | |
| project_root = Pathname.new(File.dirname(__FILE__)).parent.parent.expand_path | |
| rakefile = project_root.join('Rakefile') | |
| File.exist?(rakefile).should be_true | |
| puts `rake -f #{rakefile} build` | |
| end | |
| When /^I install the latest gem$/ do | |
| project_root = Pathname.new(File.dirname(__FILE__)).parent.parent.expand_path | |
| pkg_dir = project_root.join('pkg') | |
| glob = File.join(pkg_dir, '*.gem') | |
| latest = Dir.glob(glob).sort {|a, b| File.ctime(a) <=> File.ctime(b) }.last | |
| 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 | |
| end | |
| Then /^I can generate a new project$/ do | |
| testproj = "testproj-#{Time.now.to_i}" | |
| FileUtils.rm_rf("/tmp/#{testproj}") | |
| silent_system("cd /tmp ; cucumber-nagios-gen project #{testproj}").should be_true | |
| File.exists?("/tmp/#{testproj}").should be_true | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment