aruba-jbb 0.2.6 → 0.2.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.bundle/config +2 -0
- data/.gitignore +1 -0
- data/.rvmrc +1 -0
- data/Gemfile +10 -0
- data/History.txt +45 -7
- data/README.rdoc +7 -4
- data/Rakefile +7 -45
- data/aruba-jbb.gemspec +14 -45
- data/features/file_system_commands.feature +25 -6
- data/features/interactive.feature +30 -0
- data/features/output.feature +9 -1
- data/features/step_definitions/aruba_dev_steps.rb +7 -2
- data/lib/aruba/api.rb +320 -204
- data/lib/aruba/aruba_extension_steps.rb +13 -0
- data/lib/aruba/cucumber.rb +213 -0
- data/lib/aruba/cucumber_steps.rb +81 -67
- data/lib/aruba.rb +3 -1
- metadata +50 -17
- data/features/running_ruby.feature +0 -76
data/.bundle/config
ADDED
data/.gitignore
CHANGED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm @cucumber
|
data/Gemfile
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
gemspec
|
3
|
+
|
4
|
+
# Use source from sibling folders (if available) instead of gems
|
5
|
+
%w[cucumber].each do |g|
|
6
|
+
if File.directory?(File.dirname(__FILE__) + "/../#{g}")
|
7
|
+
@dependencies.reject!{|dep| dep.name == g}
|
8
|
+
gem g, :path => "../#{g}"
|
9
|
+
end
|
10
|
+
end
|
data/History.txt
CHANGED
@@ -1,30 +1,58 @@
|
|
1
|
-
== 0.2.6
|
1
|
+
== 0.2.6.2 jbb
|
2
|
+
* merged aslak aruba-0.2.3
|
3
|
+
|
4
|
+
== 0.2.6 jbb
|
2
5
|
* Altered rebase method to handle Ruby 1.9 changes to String class. (JBB)
|
3
6
|
|
4
|
-
== 0.2.5
|
7
|
+
== 0.2.5 jbb
|
5
8
|
* Fixed initialization error in aruba_working)dir_init. (JBB)
|
6
9
|
* Extended cucumber_step matchers for file creation and contents. (JBB)
|
7
10
|
|
8
|
-
|
11
|
+
|
12
|
+
== 0.2.4 jbb
|
9
13
|
* Added file should/should not contain:$ step matchers. (JBB)
|
10
14
|
* Expanded directory and file detection self-test cross-check. (JBB)
|
11
15
|
|
12
|
-
|
16
|
+
|
17
|
+
== 0.2.3 jbb
|
13
18
|
* Fixed no directories step error and added scenario to test this
|
14
19
|
|
15
|
-
== 0.2.
|
20
|
+
== 0.2.3 aslak
|
21
|
+
|
22
|
+
=== Bug fixes
|
23
|
+
* Directory should not exist gives false-positive (#13,#15 Nicholas Rutherford)
|
24
|
+
|
25
|
+
=== New Features
|
26
|
+
* Added step definitions for comparing file contents with regexps (#9 Aslak Hellesøy)
|
27
|
+
* Always put ./bin at the beginning of $PATH to make it easier to run own executables (#7 Aslak Hellesøy)
|
28
|
+
* Communication with interactive processes (#4 Mike Sassak)
|
29
|
+
* Remove hyphens separating stdout and stderr (Arve Knudsen)
|
30
|
+
|
31
|
+
|
32
|
+
== 0.2.2 jbb
|
16
33
|
* Extensive refactoring of steps and api. (JBB)
|
17
34
|
* Added rebase method to api and associated tags (JBB)
|
18
35
|
* Forked from Aruba 0.2.1 and renamed to aruba-jbb (JBB)
|
19
36
|
* Removed unnecessary dependencies on cucumber and rspec beta versions. (JBB)
|
20
37
|
|
21
|
-
== 0.2.
|
38
|
+
== 0.2.2 aslak
|
39
|
+
|
40
|
+
=== New Features
|
41
|
+
* Added a @bin tag that sets up './bin' first on the path (Aslak Hellesøy)
|
42
|
+
* Richer API making aruba easier to use from Ruby code. (Mark Nijhof, Aslak Hellesøy)
|
43
|
+
|
44
|
+
=== Removed Features
|
45
|
+
* No more support for RVM. Use rvm 1.9.2,1.8.7 exec cucumber .... instead. (Mark Nijhof, Aslak Hellesøy)
|
46
|
+
|
47
|
+
|
48
|
+
== 0.2.1 aslak
|
22
49
|
|
23
50
|
=== Bugfixes
|
24
51
|
* Always compare with RSpec should =~ instead of should match.
|
25
52
|
This gives a diff when there is no match. (Aslak Hellesøy)
|
26
53
|
|
27
|
-
|
54
|
+
|
55
|
+
== 0.2.0 aslak
|
28
56
|
|
29
57
|
=== New Features
|
30
58
|
* Added aruba.gemspec. (David Chelimsky)
|
@@ -56,23 +84,28 @@
|
|
56
84
|
- /^I should see matching:$/
|
57
85
|
+ /^the output should match:$/
|
58
86
|
|
87
|
+
|
59
88
|
== 0.1.9
|
60
89
|
* If the GOTGEMS environment variable is set, bundler won't run (faster).
|
61
90
|
(Aslak Hellesøy)
|
62
91
|
|
92
|
+
|
63
93
|
== 0.1.8
|
64
94
|
* Use // instead of "" for "I should see matching" step. (Aslak Hellesøy)
|
65
95
|
* Replace rvm gemset character '%' with '@' for rvm 0.1.24 (#5 Ashley Moran)
|
66
96
|
* Support gem bundler, making it easier to specify gems. (Aslak Hellesøy)
|
67
97
|
|
98
|
+
|
68
99
|
== 0.1.7
|
69
100
|
* New @announce-stderr tag (Robert Wahler)
|
70
101
|
* New "I should see matching" steps using Regexp (Robert Wahler)
|
71
102
|
|
103
|
+
|
72
104
|
== 0.1.6
|
73
105
|
* When /^I successfully run "(.*)"$/ now prints the combined output if exit status is not 0. (Aslak Hellesøy)
|
74
106
|
* Add bundle to list of common ruby scripts. (Aslak Hellesøy)
|
75
107
|
|
108
|
+
|
76
109
|
== 0.1.5
|
77
110
|
* Added ability to map rvm versions to a specific version with config/aruba-rvm.yml. (Aslak Hellesøy)
|
78
111
|
* Check for presence of files. (Aslak Hellesøy)
|
@@ -81,17 +114,22 @@
|
|
81
114
|
* Added support for rvm, making it possible to choose Ruby interpreter. (Aslak Hellesøy)
|
82
115
|
* Added @announce-cmd, @announce-stdout and @announce tags, useful for seeing what's executed and outputted. (Aslak Hellesøy)
|
83
116
|
|
117
|
+
|
84
118
|
== 0.1.4
|
85
119
|
* New step definition for appending to a file (Aslak Hellesøy)
|
86
120
|
|
121
|
+
|
87
122
|
== 0.1.3
|
88
123
|
* New step definition for cd (change directory) (Aslak Hellesøy)
|
89
124
|
|
125
|
+
|
90
126
|
== 0.1.2
|
91
127
|
* Separated API from Cucumber step definitions, makes this usable without Cucumber. (Aslak Hellesøy)
|
92
128
|
|
129
|
+
|
93
130
|
== 0.1.1
|
94
131
|
* Better Regexp escaping (David Chelimsky)
|
95
132
|
|
133
|
+
|
96
134
|
== 0.1.0
|
97
135
|
* First release (David Chelimsky and Aslak Hellesøy)
|
data/README.rdoc
CHANGED
@@ -11,6 +11,7 @@ applications where the software itself may not be modified.
|
|
11
11
|
|
12
12
|
Aruba provides support for testing using various Ruby versions (see below).
|
13
13
|
|
14
|
+
|
14
15
|
== Usage
|
15
16
|
|
16
17
|
gem install aruba-jbb
|
@@ -89,10 +90,12 @@ Aruba has several tags you can use to see what command actually gets run
|
|
89
90
|
(useful if you're using the RVM steps), STDOUT or STDERR. You can put these
|
90
91
|
tags on individual scenarios, or on a feature. The tags are:
|
91
92
|
|
92
|
-
* <tt>@announce-cmd</tt>
|
93
|
-
* <tt>@announce-stdout</tt>
|
94
|
-
* <tt>@announce-stderr</tt>
|
95
|
-
* <tt>@announce</tt>
|
93
|
+
* <tt>@announce-cmd</tt> - See what command is is run
|
94
|
+
* <tt>@announce-stdout</tt> - See the stdout
|
95
|
+
* <tt>@announce-stderr</tt> - See the stderr
|
96
|
+
* <tt>@announce-dir</tt> - See the current directory
|
97
|
+
* <tt>@announce-env</tt> - See environment variables set by Aruba
|
98
|
+
* <tt>@announce</tt> - Does all of the above
|
96
99
|
|
97
100
|
== Note on Patches/Pull Requests
|
98
101
|
|
data/Rakefile
CHANGED
@@ -1,52 +1,14 @@
|
|
1
|
-
#
|
1
|
+
# encoding: utf-8
|
2
2
|
require 'rubygems'
|
3
|
-
require '
|
3
|
+
require 'bundler'
|
4
|
+
Bundler.setup
|
5
|
+
Bundler::GemHelper.install_tasks
|
4
6
|
|
5
|
-
|
6
|
-
require 'jeweler'
|
7
|
-
Jeweler::Tasks.new do |gem|
|
8
|
-
gem.version = "0.2.6"
|
9
|
-
gem.name = "aruba-jbb"
|
10
|
-
gem.summary = %Q{CLI Steps for Cucumber}
|
11
|
-
gem.description = %Q{CLI Steps for Cucumber, hand-crafted for you in Aruba}
|
12
|
-
gem.email = "cukes@googlegroups.com"
|
13
|
-
gem.homepage = "http://github.com/byrnejb/aruba"
|
14
|
-
gem.authors = ["Aslak Hellesøy", "David Chelimsky", "James B. Byrne"]
|
15
|
-
gem.add_development_dependency "rspec", ">= 1.3.0"
|
16
|
-
gem.add_development_dependency "cucumber", ">= 0.8.3"
|
17
|
-
end
|
18
|
-
Jeweler::GemcutterTasks.new
|
19
|
-
rescue LoadError
|
20
|
-
puts "Jeweler (or a dependency) is not available. \n" +
|
21
|
-
" Install it with: gem install jeweler"
|
22
|
-
end
|
23
|
-
|
24
|
-
begin
|
25
|
-
require 'cucumber/rake/task'
|
26
|
-
|
27
|
-
Cucumber::Rake::Task.new do |t|
|
28
|
-
t.cucumber_opts = %w{--tags ~@jruby} unless defined?(JRUBY_VERSION)
|
29
|
-
t.rcov = false
|
30
|
-
end
|
7
|
+
require 'cucumber/rake/task'
|
31
8
|
|
32
|
-
|
33
|
-
|
34
|
-
task :cucumber do
|
35
|
-
abort "Cucumber is not available. \n" +
|
36
|
-
" In order to run features, you must install it. \n" +
|
37
|
-
" gem install cucumber"
|
38
|
-
end
|
9
|
+
Cucumber::Rake::Task.new do |t|
|
10
|
+
t.cucumber_opts = %w{--tags ~@jruby} unless defined?(JRUBY_VERSION)
|
39
11
|
end
|
40
12
|
|
41
13
|
task :default => :cucumber
|
42
14
|
|
43
|
-
require 'rake/rdoctask'
|
44
|
-
Rake::RDocTask.new do |rdoc|
|
45
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
46
|
-
|
47
|
-
rdoc.rdoc_dir = 'rdoc'
|
48
|
-
rdoc.title = "aruba-jbb #{version}"
|
49
|
-
rdoc.rdoc_files.include('README*')
|
50
|
-
rdoc.rdoc_files.include('lib/aruba/cucumber_steps.rb')
|
51
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
52
|
-
end
|
data/aruba-jbb.gemspec
CHANGED
@@ -1,60 +1,29 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
1
|
# -*- encoding: utf-8 -*-
|
5
2
|
|
6
3
|
Gem::Specification.new do |s|
|
7
4
|
s.name = %q{aruba-jbb}
|
8
|
-
s.version = "0.2.6"
|
5
|
+
s.version = "0.2.6.2"
|
9
6
|
|
10
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
8
|
s.authors = ["Aslak Hellesøy", "David Chelimsky", "James B. Byrne"]
|
12
|
-
s.date = %q{2010-09-
|
9
|
+
s.date = %q{2010-09-29}
|
13
10
|
s.description = %q{CLI Steps for Cucumber, hand-crafted for you in Aruba}
|
14
11
|
s.email = %q{cukes@googlegroups.com}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE",
|
17
|
-
"README.rdoc"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".gitignore",
|
22
|
-
"History.txt",
|
23
|
-
"LICENSE",
|
24
|
-
"README.rdoc",
|
25
|
-
"Rakefile",
|
26
|
-
"aruba-jbb.gemspec",
|
27
|
-
"config/.gitignore",
|
28
|
-
"features/exit_statuses.feature",
|
29
|
-
"features/file_system_commands.feature",
|
30
|
-
"features/output.feature",
|
31
|
-
"features/running_ruby.feature",
|
32
|
-
"features/step_definitions/aruba_dev_steps.rb",
|
33
|
-
"features/support/env.rb",
|
34
|
-
"lib/aruba.rb",
|
35
|
-
"lib/aruba/api.rb",
|
36
|
-
"lib/aruba/cucumber_steps.rb"
|
37
|
-
]
|
38
12
|
s.homepage = %q{http://github.com/byrnejb/aruba}
|
39
13
|
s.rdoc_options = ["--charset=UTF-8"]
|
40
|
-
s.
|
41
|
-
s.rubygems_version = %q{1.3.7}
|
42
|
-
s.summary = %q{CLI Steps for Cucumber}
|
14
|
+
s.summary = %q{Cucumber steps for external process testing from the CLI}
|
43
15
|
|
44
|
-
|
45
|
-
|
46
|
-
|
16
|
+
s.add_dependency 'cucumber', '~> 0.9.0'
|
17
|
+
s.add_dependency 'background_process' # Can't specify a version - bundler/rubygems chokes on '2.1'
|
18
|
+
s.add_development_dependency 'rspec', '~> 2.0.0.beta.22'
|
47
19
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
else
|
56
|
-
s.add_dependency(%q<rspec>, [">= 1.3.0"])
|
57
|
-
s.add_dependency(%q<cucumber>, [">= 0.8.3"])
|
58
|
-
end
|
20
|
+
s.rubygems_version = "1.3.7"
|
21
|
+
s.files = `git ls-files`.split("\n")
|
22
|
+
s.test_files = `git ls-files -- {spec,features}/*`.split("\n")
|
23
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
24
|
+
s.extra_rdoc_files = ["LICENSE", "README.rdoc", "History.txt"]
|
25
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
26
|
+
s.require_path = "lib"
|
59
27
|
end
|
60
28
|
|
29
|
+
|
@@ -72,8 +72,8 @@ Feature: file system commands
|
|
72
72
|
Given I do have a directory named "foo/bar"
|
73
73
|
And I do have a directory named "foo/bla"
|
74
74
|
Then the following directories should exist:
|
75
|
-
|
76
|
-
|
75
|
+
| foo/bar |
|
76
|
+
| foo/bla |
|
77
77
|
|
78
78
|
Scenario: Cross-check for absence and presence of directories and files
|
79
79
|
Given I do have a directory named "bar/foo"
|
@@ -92,7 +92,17 @@ Feature: file system commands
|
|
92
92
|
And the following files should not exist:
|
93
93
|
| bar/foo |
|
94
94
|
| bar/ten |
|
95
|
-
| foo/one |
|
95
|
+
| foo/one |
|
96
|
+
|
97
|
+
Scenario: check for absence of directories
|
98
|
+
Given I do have a directory named "foo/bar"
|
99
|
+
And i do have a directory named "foo/bla"
|
100
|
+
Then the following step should fail with Spec::Expectations::ExpectationNotMetError:
|
101
|
+
"""
|
102
|
+
Then the following directories should not exist:
|
103
|
+
| foo/bar/ |
|
104
|
+
| foo/bla/ |
|
105
|
+
"""
|
96
106
|
|
97
107
|
Scenario: Check file contents
|
98
108
|
Given I do have a file named "foo" with:
|
@@ -107,7 +117,7 @@ Feature: file system commands
|
|
107
117
|
Hi there
|
108
118
|
"""
|
109
119
|
Then the file "foo" should not contain "HELLO WORLD"
|
110
|
-
|
120
|
+
And the file "foo" should not contain:
|
111
121
|
"""
|
112
122
|
HELLO WORLD
|
113
123
|
"""
|
@@ -128,13 +138,11 @@ Feature: file system commands
|
|
128
138
|
Then the clean_up api method should fail
|
129
139
|
And output should match /outside the tmp subtree and may not be deleted/
|
130
140
|
|
131
|
-
|
132
141
|
@rebase-test @aruba-tmpdir @announce
|
133
142
|
Scenario: @rebase-test tag creates soft links in aruba working directory
|
134
143
|
Given the rebase-test before block conditions
|
135
144
|
Then the soft links should exist in the aruba working directory
|
136
145
|
|
137
|
-
|
138
146
|
@rebase-test @aruba-tmpdir @announce
|
139
147
|
Scenario: rebase api creats soft links in aruba working directory
|
140
148
|
Given the rebase-test before block conditions
|
@@ -142,3 +150,14 @@ Feature: file system commands
|
|
142
150
|
When I rebase the directory named "rebase_test"
|
143
151
|
Then "rebase_test" should have a soft link in the aruba working directory
|
144
152
|
And I delete the cwd sub-directory named "rebase_test"
|
153
|
+
|
154
|
+
|
155
|
+
Scenario: Check file contents with regex
|
156
|
+
Given we do have a file named "foo" with:
|
157
|
+
"""
|
158
|
+
hello world
|
159
|
+
"""
|
160
|
+
Then the file "foo" should match /hel.o world/
|
161
|
+
And the file "foo" should not match /HELLO WORLD/
|
162
|
+
|
163
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
Feature: Interactive process control
|
2
|
+
|
3
|
+
In order to test interactive command line applications
|
4
|
+
As a developer using Cucumber
|
5
|
+
I want to use the interactive session steps
|
6
|
+
|
7
|
+
Scenario: Running ruby interactively
|
8
|
+
Given we do have a file named "echo.rb" with:
|
9
|
+
"""
|
10
|
+
while res = gets.chomp
|
11
|
+
break if res == "quit"
|
12
|
+
puts res.reverse
|
13
|
+
end
|
14
|
+
"""
|
15
|
+
When I run "ruby echo.rb" interactively
|
16
|
+
And I type "hello, world"
|
17
|
+
And I type "quit"
|
18
|
+
Then the output should contain:
|
19
|
+
"""
|
20
|
+
dlrow ,olleh
|
21
|
+
"""
|
22
|
+
|
23
|
+
Scenario: Running a native binary interactively
|
24
|
+
When I run "bc -q" interactively
|
25
|
+
And I type "4 + 3"
|
26
|
+
And I type "quit"
|
27
|
+
Then the output should contain:
|
28
|
+
"""
|
29
|
+
7
|
30
|
+
"""
|
data/features/output.feature
CHANGED
@@ -8,7 +8,7 @@ Feature: Output
|
|
8
8
|
When I run "neverever gonna work"
|
9
9
|
Then the output should contain:
|
10
10
|
"""
|
11
|
-
|
11
|
+
No such file or directory - neverever gonna work
|
12
12
|
"""
|
13
13
|
|
14
14
|
Scenario: Detect subset of one-line output
|
@@ -83,6 +83,14 @@ Feature: Output
|
|
83
83
|
hello
|
84
84
|
"""
|
85
85
|
|
86
|
+
@announce-stdout
|
87
|
+
Scenario: Match failing exit status and output with regex
|
88
|
+
When I run "ruby -e 'puts \"hello\\nworld\";exit 99'"
|
89
|
+
Then it should fail with regex:
|
90
|
+
"""
|
91
|
+
hello\s*world
|
92
|
+
"""
|
93
|
+
|
86
94
|
@announce-cmd
|
87
95
|
Scenario: Match output in stdout
|
88
96
|
When I run "ruby -e 'puts \"hello\\nworld\"'"
|
@@ -68,7 +68,12 @@ When /^the output should contain the current Ruby version$/ do
|
|
68
68
|
Then %{the output should contain "#{RUBY_VERSION}"}
|
69
69
|
end
|
70
70
|
|
71
|
-
|
71
|
+
|
72
72
|
When /^aruba should fail with "([^\"]*)"$/ do |error_message|
|
73
|
-
@aruba_exception.message.should =~
|
73
|
+
@aruba_exception.message.should =~ regexp(error_message)
|
74
|
+
end
|
75
|
+
|
76
|
+
|
77
|
+
When /^the following step should fail with Spec::Expectations::ExpectationNotMetError:$/ do |multiline_step|
|
78
|
+
proc {steps multiline_step}.should raise_error(RSpec::Expectations::ExpectationNotMetError)
|
74
79
|
end
|