Skip to content
Browse files

Get rid of that stupid --wip stuff

  • Loading branch information...
1 parent f0c491a commit 49c1c3a8ec697d084a185b6c3f774986890dd440 @aslakhellesoy aslakhellesoy committed Feb 24, 2010
Showing with 31 additions and 18 deletions.
  1. +3 −11 Rakefile
  2. +3 −4 features/file_system_commands.feature
  3. +12 −0 features/support/step_definitions.rb
  4. +8 −2 lib/aruba/api.rb
  5. +5 −1 lib/aruba/cucumber.rb
View
14 Rakefile
@@ -22,19 +22,11 @@ end
begin
require 'cucumber/rake/task'
- namespace :cucumber do
- Cucumber::Rake::Task.new(:pass) do |t|
- t.cucumber_opts = %w{--tags ~@fail}
- t.cucumber_opts += %w{--tags ~@jruby} unless defined?(JRUBY_VERSION)
- end
-
- Cucumber::Rake::Task.new(:fail) do |t|
- t.cucumber_opts = %w{--tags @fail --wip}
- t.cucumber_opts += %w{--tags ~@jruby} unless defined?(JRUBY_VERSION)
- end
+ Cucumber::Rake::Task.new do |t|
+ t.cucumber_opts = %w{--tags ~@jruby} unless defined?(JRUBY_VERSION)
end
- task :cucumber => [:check_dependencies, 'cucumber:pass', 'cucumber:fail']
+ task :cucumber => :check_dependencies
rescue LoadError
task :cucumber do
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
View
7 features/file_system_commands.feature
@@ -48,13 +48,13 @@ Feature: file system commands
When I run "ruby example.rb"
Then the exit status should be 1
- @fail
Scenario: Holler if cd to bad dir
Given a file named "foo/bar/example.rb" with:
"""
puts "hello world"
"""
- When I cd to "foo/nonexistant"
+ When I do aruba I cd to "foo/nonexistant"
+ Then aruba should fail with "tmp/aruba/foo/nonexistant is not a directory"
Scenario: Check for presence of a subset of files
Given an empty file named "lorem/ipsum/dolor"
@@ -64,7 +64,6 @@ Feature: file system commands
| lorem/ipsum/dolor |
| lorem/ipsum/amet |
- @fail
Scenario: Check for presence of a subset of files
- Then the following files should exist:
+ Then the following files should not exist:
| lorem/ipsum/dolor |
View
12 features/support/step_definitions.rb
@@ -2,6 +2,18 @@
File.open(filename, 'w') {|io| io.write(content)}
end
+When /^I do aruba (.*)$/ do |aruba_step|
+ begin
+ When(aruba_step)
+ rescue => e
+ @aruba_exception = e
+ end
+end
+
Then /^I should see the JRuby version$/ do
Then %{I should see "#{JRUBY_VERSION}"}
end
+
+Then /^aruba should fail with "([^\"]*)"$/ do |error_message|
+ @aruba_exception.message.should =~ compile_and_escape(error_message)
+end
View
10 lib/aruba/api.rb
@@ -40,9 +40,15 @@ def create_dir(dir_name)
end
end
- def check_file_presence(paths)
+ def check_file_presence(paths, expect_presence)
in_current_dir do
- paths.each{|path| File.should be_file(path)}
+ paths.each do |path|
+ if expect_presence
+ File.should be_file(path)
+ else
+ File.should_not be_file(path)
+ end
+ end
end
end
View
6 lib/aruba/cucumber.rb
@@ -100,5 +100,9 @@
end
Then /^the following files should exist:$/ do |files|
- check_file_presence(files.raw.map{|file_row| file_row[0]})
+ check_file_presence(files.raw.map{|file_row| file_row[0]}, true)
+end
+
+Then /^the following files should not exist:$/ do |files|
+ check_file_presence(files.raw.map{|file_row| file_row[0]}, false)
end

0 comments on commit 49c1c3a

Please sign in to comment.
Something went wrong with that request. Please try again.