Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: cucumber/aruba
...
head fork: cucumber/aruba
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
View
3  History.txt
@@ -1,3 +1,6 @@
+== 0.1.3
+* New step definition for cd (change directory) (Aslak Hellesøy)
+
== 0.1.2
* Separated API from Cucumber step definitions, makes this usable without Cucumber. (Aslak Hellesøy)
View
17 Rakefile
@@ -4,7 +4,7 @@ require 'rake'
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
- gem.version = "0.1.2"
+ gem.version = "0.1.3"
gem.name = "aruba"
gem.summary = %Q{CLI Steps for Cucumber}
gem.description = %Q{CLI Steps for Cucumber, hand-crafted for you in Aruba}
@@ -21,13 +21,20 @@ end
begin
require 'cucumber/rake/task'
- Cucumber::Rake::Task.new do |t|
- t.rcov = true
+
+ namespace :cucumber do
+ Cucumber::Rake::Task.new(:pass) do |t|
+ t.cucumber_opts = '--tags ~@fail'
+ end
+
+ Cucumber::Rake::Task.new(:fail) do |t|
+ t.cucumber_opts = '--tags @fail --wip'
+ end
end
- task :features => :check_dependencies
+ task :cucumber => [:check_dependencies, 'cucumber:pass', 'cucumber:fail']
rescue LoadError
- task :features do
+ task :cucumber do
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
end
end
View
2  aruba.gemspec
@@ -5,7 +5,7 @@
Gem::Specification.new do |s|
s.name = %q{aruba}
- s.version = "0.1.2"
+ s.version = "0.1.3"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Aslak Helles\303\270y", "David Chelimsky"]
View
24 features/file_system_commands.feature
@@ -17,8 +17,28 @@ Feature: file system commands
When I run "ruby foo/bar/example.rb"
Then I should see "hello world"
- Scenario: clean up files generated in previous scenarios
+ Scenario: clean up files generated in previous scenario
When I run "ruby foo/bar/example.rb"
Then the exit status should be 1
And I should see "No such file or directory -- foo/bar/example.rb"
-
+
+ Scenario: change to a subdir
+ Given a file named "foo/bar/example.rb" with:
+ """
+ puts "hello world"
+ """
+ When I cd to "foo/bar"
+ And I run "ruby example.rb"
+ Then I should see "hello world"
+
+ Scenario: Reset current directory from previous scenario
+ 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"
View
11 lib/aruba/api.rb
@@ -8,7 +8,16 @@ def in_current_dir(&block)
end
def current_dir
- 'tmp/aruba'
+ File.join(*dirs)
+ end
+
+ def cd(dir)
+ dirs << dir
+ raise "#{current_dir} is not a directory." unless File.directory?(current_dir)
+ end
+
+ def dirs
+ @dirs ||= ['tmp/aruba']
end
def create_file(file_name, file_content)
View
4 lib/aruba/cucumber.rb
@@ -14,6 +14,10 @@
create_file(file_name, file_content)
end
+When /^I cd to "([^\"]*)"$/ do |dir|
+ cd(dir)
+end
+
When /^I run "(.*)"$/ do |cmd|
run(unescape(cmd))
end

No commit comments for this range

Something went wrong with that request. Please try again.