aruba 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aruba (0.4.0)
4
+ aruba (0.4.1)
5
5
  bcat (>= 0.6.1)
6
6
  childprocess (>= 0.1.9)
7
- cucumber (>= 0.10.5)
7
+ cucumber (>= 0.10.7)
8
8
  rdiscount (>= 1.6.8)
9
9
  rspec (>= 2.6.0)
10
10
 
@@ -16,7 +16,7 @@ GEM
16
16
  builder (3.0.0)
17
17
  childprocess (0.1.9)
18
18
  ffi (~> 1.0.6)
19
- cucumber (1.0.0)
19
+ cucumber (0.10.7)
20
20
  builder (>= 2.1.2)
21
21
  diff-lcs (>= 1.1.2)
22
22
  gherkin (~> 2.4.0)
@@ -26,7 +26,7 @@ GEM
26
26
  ffi (1.0.9)
27
27
  gherkin (2.4.0)
28
28
  json (>= 1.4.6)
29
- json (1.5.1)
29
+ json (1.5.2)
30
30
  rack (1.3.0)
31
31
  rdiscount (1.6.8)
32
32
  rspec (2.6.0)
@@ -1,85 +1,69 @@
1
- == 0.4.0
1
+ ## [v0.4.1](https://github.com/cucumber/aruba/compare/v0.4.0...v0.4.1)
2
+
3
+ * Move more logic into Aruba::Api (Aslak Hellesøy)
4
+
5
+ ## [v0.4.0](https://github.com/cucumber/aruba/compare/v0.3.7...v0.4.0)
2
6
 
3
7
  * New, awesome HTML reporting feature that captures everything that happens during a scenario. (Aslak Hellesøy)
4
8
  * ANSI escapes from output are stripped by default. Override this with the @ansi tag. (Aslak Hellesøy)
5
9
 
6
- == 0.3.7
10
+ ## [v0.3.7](https://github.com/cucumber/aruba/compare/v0.3.6...v0.3.7)
7
11
 
8
12
  * Make Aruba::Api#get_process return the last executed process with passed cmd (Potapov Sergey)
9
13
  * Replace announce with puts to comply with cucumber 0.10.6 (Aslak Hellesøy)
10
14
  * Fix childprocess STDIN to be synchronous (#40, #71 Tim Ekl)
11
15
 
12
- == 0.3.6
16
+ ## [v0.3.6](https://github.com/cucumber/aruba/compare/v0.3.5...v0.3.6)
13
17
 
14
18
  * Changed default value of @aruba_timeout_seconds from 1 to 3. (Aslak Hellesøy)
15
19
  * Separate hooks and steps to make it easier to build your own steps on top of Aruba's API (Mike Sassak)
16
20
  * @no-clobber to prevent cleanup before each scenario (Mike Sassak)
17
21
 
18
- == 0.3.5
22
+ ## [v0.3.5](https://github.com/cucumber/aruba/compare/v0.3.4...v0.3.5)
19
23
 
20
- === Bugfixes
21
24
  * Store processes in an array to ensure order of operations on Ruby 1.8.x (#48 Mike Sassak)
22
25
 
23
- == 0.3.4
26
+ ## [v0.3.4](https://github.com/cucumber/aruba/compare/v0.3.3...v0.3.4)
24
27
 
25
- * Use backticks (`) instead of quotes (") to specify command line. Quote still works, but is deprecated. (Anthony Eden, Aslak Hellesøy)
28
+ * Use backticks (\`) instead of quotes (") to specify command line. Quote still works, but is deprecated. (Anthony Eden, Aslak Hellesøy)
26
29
 
27
- == 0.3.3
30
+ ## [v0.3.3](https://github.com/cucumber/aruba/compare/v0.3.2...v0.3.3)
28
31
 
29
32
  * Updated RSpec development requirement to 2.5 (Robert Speicher, Mike Sassak, Aslak Hellesøy)
30
33
  * Updated RubyGems dependency to 1.6.1 (Robert Speicher)
31
34
 
32
- == 0.3.2
35
+ ## [v0.3.2](https://github.com/cucumber/aruba/compare/v0.3.1...v0.3.2)
33
36
 
34
- === Bugfixes
35
37
  * Wrong number of args in the When I overwrite step (Aslak Hellesøy)
36
38
 
37
- == 0.3.1
39
+ ## [v0.3.1](https://github.com/cucumber/aruba/compare/v0.3.0...v0.3.1)
38
40
 
39
- === Bugfixes
40
41
  * Broken 0.3.0 release (#43, #44 Mike Sassak)
41
-
42
- === Changed Features
43
42
  * Quotes (") and newline (\n) in step arguments are no longer unescaped. (Aslak Hellesøy)
44
43
 
45
- == 0.3.0
44
+ ## [v0.3.0](https://github.com/cucumber/aruba/compare/v0.2.8...v0.3.0)
46
45
 
47
- === Bugfixes
48
46
  * Remove latency introduced in the 0.2.8 release (#42 Mike Sassak)
49
-
50
- === New Features
51
47
  * New stepdef Then /^the stdout should contain:$/ do |partial_output| (Aslak Hellesøy)
52
-
53
- === Changed Features
54
48
  * Quotes (") and newline (\n) in step arguments no longer need to be backslash-escaped. (Aslak Hellesøy)
55
49
 
56
- == 0.2.8
50
+ ## [v0.2.8](https://github.com/cucumber/aruba/compare/v0.2.7...v0.2.8)
57
51
 
58
- === New Features
59
52
  * Replaced background_process with childprocess, a cross-platform process control library. This will allow Aruba to run on Windows and JRuby in addition to *nix MRI. (#16, #27, #31 Mike Sassak, Jari Bakken, Matt Wynne, Arve Knudsen)
60
53
 
61
- == 0.2.7
54
+ ## [v0.2.7](https://github.com/cucumber/aruba/compare/v0.2.6...v0.2.7)
62
55
 
63
- === New Features
64
56
  * Upgrade to Cucumber 0.10.0. (Aslak Hellesøy)
65
-
66
- === Changed Features
67
57
  * require 'aruba' does nothing - you have to require 'aruba/cucumber' now. This is to prevent bundler from loading it when we don't want to. (Aslak Hellesøy)
68
-
69
- === Bug fixes
70
58
  * Outputting a lot of data causes process to time out (#30 Mike Sassak)
71
59
 
72
- == 0.2.6
60
+ ## [v0.2.6](https://github.com/cucumber/aruba/compare/v0.2.5...v0.2.6)
73
61
 
74
- === New Features
75
62
  * You can set @aruba_timeout_seconds in a Before hook to tell Aruba to wait for a process to complete. Default: 1 second. (Aslak Hellesøy)
76
-
77
- === Bug fixes
78
63
  * Fixed small bug in /^the stdout should contain exactly:$/ (Aslak Hellesøy)
79
64
 
80
- == 0.2.5
65
+ ## [v0.2.5](https://github.com/cucumber/aruba/compare/v0.2.4...v0.2.5)
81
66
 
82
- === New Features
83
67
  * Added 'a file named "whatever" should (not) exist' (Robert Speicher)
84
68
  * Added 'a directory named "whatever" should (not) exist' (Robert Speicher)
85
69
  * Added /^the stderr should contain exactly:"$/ (Aslak Hellesøy)
@@ -87,90 +71,82 @@
87
71
  * Added /it should pass with exactly:/ (Aslak Hellesøy)
88
72
  * @announce, @announce-dir and @announce-cmd for interactive processes (Mike Sassak)
89
73
  * Add step defs for detecting output, stdout and stderr by process name (Mike Sassak)
90
-
91
- === Bug fixes
92
74
  * Stop all processes before verifying filesystem changes to ensure async operations are complete (#17 Mike Sassak)
93
75
  * Outputting large amounts of data causes run steps to hang (#18 Mike Sassak)
94
76
 
95
- == 0.2.4
77
+ ## [v0.2.4](https://github.com/cucumber/aruba/compare/v0.2.3...v0.2.4)
96
78
 
97
- === New Features
98
79
  * Added step definitions for removing files and checking presence of a single file. (Aslak Hellesøy)
99
80
 
100
- == 0.2.3
81
+ ## [v0.2.3](https://github.com/cucumber/aruba/compare/v0.2.2...v0.2.3)
101
82
 
102
- === Bug fixes
103
83
  * Directory should not exist gives false-positive (#13,#15 Nicholas Rutherford)
104
-
105
- === New Features
106
84
  * Added step definitions for comparing file contents with regexps (#9 Aslak Hellesøy)
107
85
  * Always put ./bin at the beginning of $PATH to make it easier to run own executables (#7 Aslak Hellesøy)
108
86
  * Communication with interactive processes (#4 Mike Sassak)
109
87
  * Remove hyphens separating stdout and stderr (Arve Knudsen)
110
88
 
111
- == 0.2.2
89
+ ## [v0.2.2](https://github.com/cucumber/aruba/compare/v0.2.1...v0.2.2)
112
90
 
113
- === New Features
114
91
  * Added a @bin tag that sets up './bin' first on the path (Aslak Hellesøy)
115
92
  * Richer API making aruba easier to use from Ruby code. (Mark Nijhof, Aslak Hellesøy)
116
-
117
- === Removed Features
118
93
  * No more support for RVM. Use rvm 1.9.2,1.8.7 exec cucumber .... instead. (Mark Nijhof, Aslak Hellesøy)
119
94
 
120
- == 0.2.1
95
+ ## [v0.2.1](https://github.com/cucumber/aruba/compare/v0.2.0...v0.2.1)
121
96
 
122
- === Bugfixes
123
97
  * Always compare with RSpec should =~ instead of should match. This gives a diff when there is no match. (Aslak Hellesøy)
124
98
 
125
- == 0.2.0
99
+ ## [v0.2.0](https://github.com/cucumber/aruba/compare/v0.1.9...v0.2.0)
126
100
 
127
- === New Features
128
101
  * Added aruba.gemspec. (David Chelimsky)
129
-
130
- === Changed features
131
102
  * Several step definitions regarding output have changed. (#1 Aslak Hellesøy)
132
103
 
133
- - /^I should see "([^\"]*)"$/
134
- + /^the output should contain "([^"]*)"$/
104
+ - /^I should see "([^\"]*)"$/
105
+ + /^the output should contain "([^"]*)"$/
106
+
107
+ - /^I should not see "([^\"]*)"$/
108
+ + /^the output should not contain "([^"]*)"$/
135
109
 
136
- - /^I should not see "([^\"]*)"$/
137
- + /^the output should not contain "([^"]*)"$/
110
+ - /^I should see:$/
111
+ + /^the output should contain:$/
138
112
 
139
- - /^I should see:$/
140
- + /^the output should contain:$/
113
+ - /^I should not see:$/
114
+ + /^the output should not contain:$/
141
115
 
142
- - /^I should not see:$/
143
- + /^the output should not contain:$/
116
+ - /^I should see exactly "([^\"]*)"$/
117
+ + /^the output should contain exactly "([^"]*)"$/
144
118
 
145
- - /^I should see exactly "([^\"]*)"$/
146
- + /^the output should contain exactly "([^"]*)"$/
119
+ - /^I should see exactly:$/
120
+ + /^the output should contain exactly:$/
147
121
 
148
- - /^I should see exactly:$/
149
- + /^the output should contain exactly:$/
122
+ - /^I should see matching \/([^\/]*)\/$/
123
+ + /^the output should match \/([^\/]*)\/$/
150
124
 
151
- - /^I should see matching \/([^\/]*)\/$/
152
- + /^the output should match \/([^\/]*)\/$/
125
+ - /^I should see matching:$/
126
+ + /^the output should match:$/
153
127
 
154
- - /^I should see matching:$/
155
- + /^the output should match:$/
128
+ ## [v0.1.9](https://github.com/cucumber/aruba/compare/v0.1.8...v0.1.9)
156
129
 
157
- == 0.1.9
158
130
  * If the GOTGEMS environment variable is set, bundler won't run (faster). (Aslak Hellesøy)
159
131
 
160
- == 0.1.8
132
+ ## [v0.1.8](https://github.com/cucumber/aruba/compare/v0.1.7...v0.1.8)
133
+
161
134
  * Use // instead of "" for "I should see matching" step. (Aslak Hellesøy)
162
135
  * Replace rvm gemset character '%' with '@' for rvm 0.1.24 (#5 Ashley Moran)
163
136
  * Support gem bundler, making it easier to specify gems. (Aslak Hellesøy)
164
137
 
165
- == 0.1.7
138
+ ## [v0.1.7](https://github.com/cucumber/aruba/compare/v0.1.6...v0.1.7)
139
+
166
140
  * New @announce-stderr tag (Robert Wahler)
167
141
  * New "I should see matching" steps using Regexp (Robert Wahler)
168
142
 
169
- == 0.1.6
143
+ ## [v0.1.6](https://github.com/cucumber/aruba/compare/v0.1.5...v0.1.6)
144
+
170
145
  * When /^I successfully run "(.*)"$/ now prints the combined output if exit status is not 0. (Aslak Hellesøy)
171
146
  * Add bundle to list of common ruby scripts. (Aslak Hellesøy)
172
147
 
173
- == 0.1.5
148
+ ## [v0.1.5](https://github.com/cucumber/aruba/compare/v0.1.4...v0.1.5)
149
+
174
150
  * Added ability to map rvm versions to a specific version with config/aruba-rvm.yml. (Aslak Hellesøy)
175
151
  * Check for presence of files. (Aslak Hellesøy)
176
152
  * Allow specification of rvm gemsets. (Aslak Hellesøy)
@@ -178,17 +154,22 @@
178
154
  * Added support for rvm, making it possible to choose Ruby interpreter. (Aslak Hellesøy)
179
155
  * Added @announce-cmd, @announce-stdout and @announce tags, useful for seeing what's executed and outputted. (Aslak Hellesøy)
180
156
 
181
- == 0.1.4
157
+ ## [v0.1.4](https://github.com/cucumber/aruba/compare/v0.1.3...v0.1.4)
158
+
182
159
  * New step definition for appending to a file (Aslak Hellesøy)
183
160
 
184
- == 0.1.3
161
+ ## [v0.1.3](https://github.com/cucumber/aruba/compare/v0.1.2...v0.1.3)
162
+
185
163
  * New step definition for cd (change directory) (Aslak Hellesøy)
186
164
 
187
- == 0.1.2
165
+ ## [v0.1.2](https://github.com/cucumber/aruba/compare/v0.1.1...v0.1.2)
166
+
188
167
  * Separated API from Cucumber step definitions, makes this usable without Cucumber. (Aslak Hellesøy)
189
168
 
190
- == 0.1.1
169
+ ## [v0.1.1](https://github.com/cucumber/aruba/compare/v0.1.0...v0.1.1)
170
+
191
171
  * Better Regexp escaping (David Chelimsky)
192
172
 
193
- == 0.1.0
173
+ ## [v0.1.0](https://github.com/cucumber/aruba/compare/ed6a175d23aaff62dbf355706996f276f304ae8b...v0.1.1)
174
+
194
175
  * First release (David Chelimsky and Aslak Hellesøy)
@@ -4,70 +4,89 @@ Aruba is Cucumber extension for Command line applications written in any program
4
4
  * Manipulate the file system
5
5
  * Create great HTML documentation based on your own Cucumber scenarios
6
6
 
7
- == Usage
7
+ ## Usage
8
8
 
9
- gem install aruba
9
+ If you have a `Gemfile`, add `aruba`. Otherwise, install it like this:
10
10
 
11
- Then, just require the library in one of your ruby files under <tt>features/support</tt> (e.g. <tt>env.rb</tt>)
11
+ gem install aruba
12
12
 
13
- require 'aruba/cucumber'
13
+ Then, `require` the library in one of your ruby files under `features/support` (e.g. `env.rb`)
14
14
 
15
- You now have a bunch of step definitions that you can use in your features. Look at aruba/cucumber.rb
16
- to see all the step definitions. Look at features/*.feature for examples (which are also testing Aruba
15
+ require 'aruba/cucumber'
16
+
17
+ You now have a bunch of step definitions that you can use in your features. Look at `lib/aruba/cucumber.rb`
18
+ to see them all. Look at `features/*.feature` for examples (which are also testing Aruba
17
19
  itself).
18
20
 
19
- == Tags
21
+ ## Configuration
20
22
 
21
- Aruba has tags you can put on on individual scenarios, or on a feature.
23
+ Aruba has some default behaviour that you can change if you need to.
22
24
 
23
- To get more information use these tags:
25
+ ### Use a different working directory
24
26
 
25
- * <tt>@announce-cmd</tt> - See what command is is run
26
- * <tt>@announce-stdout</tt> - See the stdout
27
- * <tt>@announce-stderr</tt> - See the stderr
28
- * <tt>@announce-dir</tt> - See the current directory
29
- * <tt>@announce-env</tt> - See environment variables set by Aruba
30
- * <tt>@announce</tt> - Does all of the above
27
+ Per default Aruba will create a directory `tmp/aruba` where it performs its file operations.
28
+ If you want to change this behaviour put this into your `features/support/env.rb`:
31
29
 
32
- To prevent Aruba from removing its working directory before each scenario:
30
+ Before do
31
+ @dirs = ["somewhere/else"]
32
+ end
33
33
 
34
- * <tt>@no-clobber</tt> - Don't cleanup before scenarios
35
34
 
36
- Aruba strips away ANSI escapes from the stdout and stderr of spawned children by default. If you want to override this behaviour
37
- and leave the ANSI escape characters intact, just tag your scenario with <tt>@ansi</tt>. Alternatively you can add your own Before
38
- hook that sets @aruba_keep_ansi=true
35
+ ### Modify the PATH
39
36
 
40
- == Runtime Configuration
37
+ If testing an executable in your project's `bin` directory, it might not be in the `PATH` Aruba
38
+ uses. An easy way to set it is to put the following in `features/support/env.rb`:
41
39
 
42
- Per default Aruba will create a directory <tt>tmp/aruba</tt> where it performs it's file operations.
43
- If you want to change this behaviour put this into your <tt>features/support/env.rb</tt>:
40
+ ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
44
41
 
45
- Before do
46
- @dirs = ["somewhere/else"]
47
- end
42
+ ### Increasing timeouts
48
43
 
49
- If testing an executable in your project's `bin` directory, it might not be in the path Aruba
50
- uses. An easy way to set it is to put the following in <tt>features/support/env.rb</tt>:
44
+ A process sometimes takes longer than expected to terminate, and Aruba will kill them off (and fail your scenario) if it is still alive after 3 seconds. If you need more time you can modify the timeout by assigning a different value to `@aruba_timeout_seconds` in a `Before` block:
51
45
 
52
- ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
46
+ Before do
47
+ @aruba_timeout_seconds = 5
48
+ end
53
49
 
54
- Set <tt>@aruba_timeout_seconds</tt> to control the amount of time Aruba will wait for a process to
55
- finish running before terminating it:
56
-
57
- Before do
58
- @aruba_timeout_seconds = 5
59
- end
50
+ ### Increasing IO wait time
60
51
 
61
52
  Running processes interactively can result in race conditions when Aruba executes an IO-related step
62
53
  but the interactive process has not yet flushed or read some content. To help prevent this Aruba waits
63
54
  before reading or writing to the process if it is still running. You can control the wait by setting
64
- <tt>@aruba_io_wait_seconds</tt> to an appropriate value. This is particularly useful with tags:
55
+ `@aruba_io_wait_seconds` to an appropriate value. This is particularly useful with tags:
56
+
57
+ Before('@slow_process') do
58
+ @aruba_io_wait_seconds = 5
59
+ end
60
+
61
+ ### Tags
62
+
63
+ Aruba defines several tags that you can put on on individual scenarios, or on a feature.
64
+
65
+ #### Seeing more output with `@announce-*`
66
+
67
+ To get more information on what Aruba is doing, use these tags:
65
68
 
66
- Before('@slow_process') do
67
- @aruba_io_wait_seconds = 5
68
- end
69
+ * `@announce-cmd` - See what command is is run
70
+ * `@announce-stdout` - See the stdout
71
+ * `@announce-stderr` - See the stderr
72
+ * `@announce-dir` - See the current directory
73
+ * `@announce-env` - See environment variables set by Aruba
74
+ * `@announce` - Does all of the above
69
75
 
70
- == Reporting
76
+ #### Keep files around with `@no-clobber`
77
+
78
+ Aruba clobbers all files in its working directory before each scenario. -Unless you tag it with `@no-clobber`
79
+
80
+ #### Making assertions about ANSI escapes with `@ansi`
81
+
82
+ Aruba strips away ANSI escapes from the stdout and stderr of spawned child processes by default. It's usually rather cumbersome to
83
+ make assertions about coloured output. Still, there might be cases where you want to leave the ANSI escapes intact. Just tag your
84
+ scenario with `@ansi`. Alternatively you can add your own Before
85
+ hook that sets `@aruba_keep_ansi = true`.
86
+
87
+ ## Reporting
88
+
89
+ *Important* - you need [Pygments](http://pygments.org/) installed to use this feature.
71
90
 
72
91
  Aruba can generate a HTML page for each scenario that contains:
73
92
 
@@ -75,9 +94,9 @@ Aruba can generate a HTML page for each scenario that contains:
75
94
  * The description from the scenario (You can use Markdown here)
76
95
  * The command(s) that were run
77
96
  * The output from those commands (in colour if the output uses ANSI escapes)
78
- * The files that were created (in colour - syntax highlighted by [Pygments](http://pygments.org/))
97
+ * The files that were created (syntax highlighted in in colour)
79
98
 
80
- Reporting is off by default, but you can enable it by defining the`ARUBA_REPORT_DIR` environment variable, giving it the value
99
+ Reporting is off by default, but you can enable it by defining the `ARUBA_REPORT_DIR` environment variable, giving it the value
81
100
  where reports should be written:
82
101
 
83
102
  ARUBA_REPORT_DIR=doc cucumber features
@@ -89,10 +108,10 @@ This will use Aruba's built-in template by default (See the `templates` folder).
89
108
  The templates directory must contain a `main.erb` and `files.erb` template. It can also contain other assets such
90
109
  as css, javascript and images. All of these files will be copied over to the report dir well.
91
110
 
92
- === Escaping Markdown
111
+ ### Escaping Markdown
93
112
 
94
113
  There are some edge cases where Gherkin and Markdown don't agree. Bullet lists using `*` is one example. The `*` is also an alias for
95
- step keywords in Gherkin. Markdown headers (the kind starting with a #) is another example. They are parsed as comments by Gherkin. To use either of these, just escape them with a backslash. So instead of writing:
114
+ step keywords in Gherkin. Markdown headers (the kind starting with a `#`) is another example. They are parsed as comments by Gherkin. To use either of these, just escape them with a backslash. So instead of writing:
96
115
 
97
116
  Scenario: Make tea
98
117
  ## Making tea
@@ -117,31 +136,22 @@ Another option is to use alternative Markdown syntax and omit conflicts and esca
117
136
 
118
137
  Scenario: Make tea
119
138
  Making tea
120
- ==========
139
+ ----------
121
140
  - Get a pot
122
141
  - And some hot water
123
142
 
124
143
  Given...
125
144
 
126
- === Prerequisites
127
-
128
- Aruba doesn't bundle all of the tools needed for report generation. You have to add these yourself to your project:
129
-
130
- * bcat (gem)
131
- * rdiscount (gem)
132
- * pygments
133
-
134
- == Note on Patches/Pull Requests
145
+ ## Note on Patches/Pull Requests
135
146
 
136
147
  * Fork the project.
137
148
  * Make your feature addition or bug fix.
138
149
  * Add tests for it. This is important so I don't break it in a
139
150
  future version unintentionally. Note: the existing tests may fail
140
- with pre-1.9 versions of ruby; upgrade to get clean runs.
141
- * Commit, do not mess with rakefile, version, or history.
151
+ * Commit, do not mess with Rakefile, gemspec or History.
142
152
  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
143
153
  * Send me a pull request. Bonus points for topic branches.
144
154
 
145
- == Copyright
155
+ ## Copyright
146
156
 
147
- Copyright (c) 2010 Aslak Hellesøy and David Chelimsky. See LICENSE for details.
157
+ Copyright (c) 2010,2011 Aslak Hellesøy, David Chelimsky and Mike Sassak. See LICENSE for details.
data/aruba.gemspec CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'aruba'
5
- s.version = '0.4.0'
5
+ s.version = '0.4.1'
6
6
  s.authors = ["Aslak Hellesøy", "David Chelimsky", "Mike Sassak"]
7
7
  s.description = 'CLI Steps for Cucumber, hand-crafted for you in Aruba'
8
8
  s.summary = "aruba-#{s.version}"
9
9
  s.email = 'cukes@googlegroups.com'
10
10
  s.homepage = 'http://github.com/aslakhellesoy/aruba'
11
11
 
12
- s.add_dependency 'cucumber', '>= 0.10.5'
12
+ s.add_dependency 'cucumber', '>= 0.10.7'
13
13
  s.add_dependency 'childprocess', '>= 0.1.9'
14
14
  s.add_dependency 'rspec', '>= 2.6.0'
15
15
  s.add_dependency 'bcat', '>= 0.6.1'
@@ -19,7 +19,6 @@ Gem::Specification.new do |s|
19
19
  s.files = `git ls-files`.split("\n")
20
20
  s.test_files = `git ls-files -- {spec,features}/*`.split("\n")
21
21
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
- s.extra_rdoc_files = ["LICENSE", "README.rdoc", "History.txt"]
23
22
  s.rdoc_options = ["--charset=UTF-8"]
24
23
  s.require_path = "lib"
25
24
  end
data/lib/aruba/api.rb CHANGED
@@ -148,6 +148,14 @@ module Aruba
148
148
  unescape(actual).should include(unescape(expected))
149
149
  end
150
150
 
151
+ def assert_matching_output(expected, actual)
152
+ unescape(actual).should =~ /#{unescape(expected)}/m
153
+ end
154
+
155
+ def assert_no_partial_output(unexpected, actual)
156
+ actual.should_not include(unexpected)
157
+ end
158
+
151
159
  def assert_passing_with(expected)
152
160
  assert_exit_status_and_partial_output(true, expected)
153
161
  end
@@ -158,7 +166,7 @@ module Aruba
158
166
 
159
167
  def assert_exit_status_and_partial_output(expect_to_pass, expected)
160
168
  assert_partial_output(expected, all_output)
161
- assert_exiting_with(expect_to_pass)
169
+ assert_success(expect_to_pass)
162
170
  end
163
171
 
164
172
  # TODO: Remove this. Call more methods elsewhere instead. Reveals more intent.
@@ -168,15 +176,19 @@ module Aruba
168
176
  else
169
177
  assert_partial_output(expected_output, all_output)
170
178
  end
171
- assert_exiting_with(expect_to_pass)
179
+ assert_success(expect_to_pass)
172
180
  end
173
181
 
174
- def assert_exiting_with(expect_to_pass)
175
- if expect_to_pass
176
- @last_exit_status.should == 0
177
- else
178
- @last_exit_status.should_not == 0
179
- end
182
+ def assert_success(success)
183
+ success ? assert_exit_status(0) : assert_not_exit_status(0)
184
+ end
185
+
186
+ def assert_exit_status(status)
187
+ @last_exit_status.should == status
188
+ end
189
+
190
+ def assert_not_exit_status(status)
191
+ @last_exit_status.should_not == status
180
192
  end
181
193
 
182
194
  def processes
@@ -79,20 +79,20 @@ Then /^the output from "([^"]*)" should contain "([^"]*)"$/ do |cmd, expected|
79
79
  assert_partial_output(expected, output_from(cmd))
80
80
  end
81
81
 
82
- Then /^the output from "([^"]*)" should not contain "([^"]*)"$/ do |cmd, partial_output|
83
- output_from(cmd).should_not include(partial_output)
82
+ Then /^the output from "([^"]*)" should not contain "([^"]*)"$/ do |cmd, unexpected|
83
+ assert_no_partial_output(unexpected, output_from(cmd))
84
84
  end
85
85
 
86
- Then /^the output should not contain "([^"]*)"$/ do |partial_output|
87
- all_output.should_not include(partial_output)
86
+ Then /^the output should not contain "([^"]*)"$/ do |unexpected|
87
+ assert_no_partial_output(unexpected, all_output)
88
88
  end
89
89
 
90
90
  Then /^the output should contain:$/ do |expected|
91
91
  assert_partial_output(expected, all_output)
92
92
  end
93
93
 
94
- Then /^the output should not contain:$/ do |partial_output|
95
- all_output.should_not include(partial_output)
94
+ Then /^the output should not contain:$/ do |unexpected|
95
+ assert_no_partial_output(unexpected, all_output)
96
96
  end
97
97
 
98
98
  Then /^the output should contain exactly "([^"]*)"$/ do |expected|
@@ -107,20 +107,20 @@ end
107
107
  # you don't need regex, use "the output should contain" instead since
108
108
  # that way, you don't have to escape regex characters that
109
109
  # appear naturally in the output
110
- Then /^the output should match \/([^\/]*)\/$/ do |partial_output|
111
- all_output.should =~ /#{partial_output}/
110
+ Then /^the output should match \/([^\/]*)\/$/ do |expected|
111
+ assert_matching_output(expected, all_output)
112
112
  end
113
113
 
114
- Then /^the output should match:$/ do |partial_output|
115
- all_output.should =~ /#{partial_output}/m
114
+ Then /^the output should match:$/ do |expected|
115
+ assert_matching_output(expected, all_output)
116
116
  end
117
117
 
118
118
  Then /^the exit status should be (\d+)$/ do |exit_status|
119
- @last_exit_status.should == exit_status.to_i
119
+ assert_exit_status(exit_status.to_i)
120
120
  end
121
121
 
122
122
  Then /^the exit status should not be (\d+)$/ do |exit_status|
123
- @last_exit_status.should_not == exit_status.to_i
123
+ assert_not_exit_status(exit_status.to_i)
124
124
  end
125
125
 
126
126
  Then /^it should (pass|fail) with:$/ do |pass_fail, partial_output|
@@ -131,25 +131,21 @@ Then /^it should (pass|fail) with exactly:$/ do |pass_fail, exact_output|
131
131
  assert_exit_status_and_output(pass_fail == "pass", exact_output, true)
132
132
  end
133
133
 
134
- Then /^it should (pass|fail) with regexp?:$/ do |pass_fail, partial_output|
135
- Then "the output should match:", partial_output
136
- if pass_fail == 'pass'
137
- @last_exit_status.should == 0
138
- else
139
- @last_exit_status.should_not == 0
140
- end
134
+ Then /^it should (pass|fail) with regexp?:$/ do |pass_fail, expected|
135
+ assert_matching_output(expected, all_output)
136
+ assert_success(pass_fail == 'pass')
141
137
  end
142
138
 
143
- Then /^the stderr should contain "([^"]*)"$/ do |partial_output|
144
- all_stderr.should include(partial_output)
139
+ Then /^the stderr should contain "([^"]*)"$/ do |expected|
140
+ assert_partial_output(expected, all_stderr)
145
141
  end
146
142
 
147
- Then /^the stderr should contain:$/ do |partial_output|
148
- all_stderr.should include(partial_output)
143
+ Then /^the stderr should contain:$/ do |expected|
144
+ assert_partial_output(expected, all_stderr)
149
145
  end
150
146
 
151
- Then /^the stderr should contain exactly:$/ do |exact_output|
152
- all_stderr.should == exact_output
147
+ Then /^the stderr should contain exactly:$/ do |expected|
148
+ assert_exact_output(expected, all_stderr)
153
149
  end
154
150
 
155
151
  Then /^the stdout should contain "([^"]*)"$/ do |expected|
@@ -160,40 +156,40 @@ Then /^the stdout should contain:$/ do |expected|
160
156
  assert_partial_output(expected, all_stdout)
161
157
  end
162
158
 
163
- Then /^the stdout should contain exactly:$/ do |exact_output|
164
- all_stdout.should == exact_output
159
+ Then /^the stdout should contain exactly:$/ do |expected|
160
+ assert_exact_output(expected, all_stdout)
165
161
  end
166
162
 
167
- Then /^the stderr should not contain "([^"]*)"$/ do |partial_output|
168
- all_stderr.should_not include(partial_output)
163
+ Then /^the stderr should not contain "([^"]*)"$/ do |unexpected|
164
+ assert_no_partial_output(unexpected, all_stderr)
169
165
  end
170
166
 
171
- Then /^the stderr should not contain:$/ do |partial_output|
172
- all_stderr.should_not include(partial_output)
167
+ Then /^the stderr should not contain:$/ do |unexpected|
168
+ assert_no_partial_output(unexpected, all_stderr)
173
169
  end
174
170
 
175
- Then /^the stdout should not contain "([^"]*)"$/ do |partial_output|
176
- all_stdout.should_not include(partial_output)
171
+ Then /^the stdout should not contain "([^"]*)"$/ do |unexpected|
172
+ assert_no_partial_output(unexpected, all_stdout)
177
173
  end
178
174
 
179
- Then /^the stdout should not contain:$/ do |partial_output|
180
- all_stdout.should_not include(partial_output)
175
+ Then /^the stdout should not contain:$/ do |unexpected|
176
+ assert_no_partial_output(unexpected, all_stdout)
181
177
  end
182
178
 
183
- Then /^the stdout from "([^"]*)" should contain "([^"]*)"$/ do |cmd, partial_output|
184
- stdout_from(cmd).should include(partial_output)
179
+ Then /^the stdout from "([^"]*)" should contain "([^"]*)"$/ do |cmd, expected|
180
+ assert_partial_output(expected, stdout_from(cmd))
185
181
  end
186
182
 
187
- Then /^the stdout from "([^"]*)" should not contain "([^"]*)"$/ do |cmd, partial_output|
188
- stdout_from(cmd).should_not include(partial_output)
183
+ Then /^the stdout from "([^"]*)" should not contain "([^"]*)"$/ do |cmd, unexpected|
184
+ assert_no_partial_output(unexpected, stdout_from(cmd))
189
185
  end
190
186
 
191
- Then /^the stderr from "([^"]*)" should contain "([^"]*)"$/ do |cmd, partial_output|
192
- stderr_from(cmd).should include(partial_output)
187
+ Then /^the stderr from "([^"]*)" should contain "([^"]*)"$/ do |cmd, expected|
188
+ assert_partial_output(expected, stderr_from(cmd))
193
189
  end
194
190
 
195
- Then /^the stderr from "([^"]*)" should not contain "([^"]*)"$/ do |cmd, partial_output|
196
- stderr_from(cmd).should_not include(partial_output)
191
+ Then /^the stderr from "([^"]*)" should not contain "([^"]*)"$/ do |cmd, unexpected|
192
+ assert_no_partial_output(unexpected, stderr_from(cmd))
197
193
  end
198
194
 
199
195
  Then /^the file "([^"]*)" should not exist$/ do |file_name|
@@ -41,7 +41,7 @@ if(ENV['ARUBA_REPORT_DIR'])
41
41
 
42
42
  def output
43
43
  @aruba_keep_ansi = true # We want the output coloured!
44
- escaped_stdout = CGI.escape_html(all_stdout)
44
+ escaped_stdout = CGI.escapeHTML(all_stdout)
45
45
  html = Bcat::ANSI.new(escaped_stdout).to_html
46
46
  Bcat::ANSI::STYLES.each do |name, style|
47
47
  html.gsub!(/style='#{style}'/, %{class="xterm_#{name}"})
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: aruba
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.0
5
+ version: 0.4.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - "Aslak Helles\xC3\xB8y"
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2011-06-12 00:00:00 +01:00
15
+ date: 2011-06-17 00:00:00 +01:00
16
16
  default_executable:
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
@@ -22,7 +22,7 @@ dependencies:
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: 0.10.5
25
+ version: 0.10.7
26
26
  type: :runtime
27
27
  prerelease: false
28
28
  version_requirements: *id001
@@ -76,19 +76,17 @@ executables: []
76
76
 
77
77
  extensions: []
78
78
 
79
- extra_rdoc_files:
80
- - LICENSE
81
- - README.rdoc
82
- - History.txt
79
+ extra_rdoc_files: []
80
+
83
81
  files:
84
82
  - .document
85
83
  - .gitignore
86
84
  - .rvmrc
87
85
  - Gemfile
88
86
  - Gemfile.lock
89
- - History.txt
87
+ - History.md
90
88
  - LICENSE
91
- - README.rdoc
89
+ - README.md
92
90
  - Rakefile
93
91
  - aruba.gemspec
94
92
  - config/.gitignore
@@ -133,7 +131,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
131
  requirements:
134
132
  - - ">="
135
133
  - !ruby/object:Gem::Version
136
- hash: 1136291250320371611
134
+ hash: 2933985755347301009
137
135
  segments:
138
136
  - 0
139
137
  version: "0"
@@ -142,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
140
  requirements:
143
141
  - - ">="
144
142
  - !ruby/object:Gem::Version
145
- hash: 1136291250320371611
143
+ hash: 2933985755347301009
146
144
  segments:
147
145
  - 0
148
146
  version: "0"
@@ -152,7 +150,7 @@ rubyforge_project:
152
150
  rubygems_version: 1.6.2
153
151
  signing_key:
154
152
  specification_version: 3
155
- summary: aruba-0.4.0
153
+ summary: aruba-0.4.1
156
154
  test_files:
157
155
  - features/exit_statuses.feature
158
156
  - features/file_system_commands.feature