aruba 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.1.3
2
+ * New step definition for cd (change directory) (Aslak Hellesøy)
3
+
1
4
  == 0.1.2
2
5
  * Separated API from Cucumber step definitions, makes this usable without Cucumber. (Aslak Hellesøy)
3
6
 
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require 'rake'
4
4
  begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gem|
7
- gem.version = "0.1.2"
7
+ gem.version = "0.1.3"
8
8
  gem.name = "aruba"
9
9
  gem.summary = %Q{CLI Steps for Cucumber}
10
10
  gem.description = %Q{CLI Steps for Cucumber, hand-crafted for you in Aruba}
@@ -21,13 +21,20 @@ end
21
21
 
22
22
  begin
23
23
  require 'cucumber/rake/task'
24
- Cucumber::Rake::Task.new do |t|
25
- t.rcov = true
24
+
25
+ namespace :cucumber do
26
+ Cucumber::Rake::Task.new(:pass) do |t|
27
+ t.cucumber_opts = '--tags ~@fail'
28
+ end
29
+
30
+ Cucumber::Rake::Task.new(:fail) do |t|
31
+ t.cucumber_opts = '--tags @fail --wip'
32
+ end
26
33
  end
27
34
 
28
- task :features => :check_dependencies
35
+ task :cucumber => [:check_dependencies, 'cucumber:pass', 'cucumber:fail']
29
36
  rescue LoadError
30
- task :features do
37
+ task :cucumber do
31
38
  abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
32
39
  end
33
40
  end
data/aruba.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{aruba}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Aslak Helles\303\270y", "David Chelimsky"]
@@ -17,8 +17,28 @@ Feature: file system commands
17
17
  When I run "ruby foo/bar/example.rb"
18
18
  Then I should see "hello world"
19
19
 
20
- Scenario: clean up files generated in previous scenarios
20
+ Scenario: clean up files generated in previous scenario
21
21
  When I run "ruby foo/bar/example.rb"
22
22
  Then the exit status should be 1
23
23
  And I should see "No such file or directory -- foo/bar/example.rb"
24
-
24
+
25
+ Scenario: change to a subdir
26
+ Given a file named "foo/bar/example.rb" with:
27
+ """
28
+ puts "hello world"
29
+ """
30
+ When I cd to "foo/bar"
31
+ And I run "ruby example.rb"
32
+ Then I should see "hello world"
33
+
34
+ Scenario: Reset current directory from previous scenario
35
+ When I run "ruby example.rb"
36
+ Then the exit status should be 1
37
+
38
+ @fail
39
+ Scenario: Holler if cd to bad dir
40
+ Given a file named "foo/bar/example.rb" with:
41
+ """
42
+ puts "hello world"
43
+ """
44
+ When I cd to "foo/nonexistant"
data/lib/aruba/api.rb CHANGED
@@ -8,7 +8,16 @@ module Api
8
8
  end
9
9
 
10
10
  def current_dir
11
- 'tmp/aruba'
11
+ File.join(*dirs)
12
+ end
13
+
14
+ def cd(dir)
15
+ dirs << dir
16
+ raise "#{current_dir} is not a directory." unless File.directory?(current_dir)
17
+ end
18
+
19
+ def dirs
20
+ @dirs ||= ['tmp/aruba']
12
21
  end
13
22
 
14
23
  def create_file(file_name, file_content)
@@ -14,6 +14,10 @@ Given /^a file named "([^\"]*)" with:$/ do |file_name, file_content|
14
14
  create_file(file_name, file_content)
15
15
  end
16
16
 
17
+ When /^I cd to "([^\"]*)"$/ do |dir|
18
+ cd(dir)
19
+ end
20
+
17
21
  When /^I run "(.*)"$/ do |cmd|
18
22
  run(unescape(cmd))
19
23
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Aslak Helles\xC3\xB8y"