Skip to content
This repository
  • 5 commits
  • 5 files changed
  • 0 comments
  • 2 contributors
8 History.txt
... ... @@ -1,3 +1,11 @@
  1 +== 0.3.1
  2 +
  3 +=== Bugfixes
  4 +* Broken 0.3.0 release (#43, #44 Mike Sassak)
  5 +
  6 +=== Changed Features
  7 +* Quotes (") and newline (\n) in step arguments are no longer unescaped. (Aslak Hellesøy)
  8 +
1 9 == 0.3.0
2 10
3 11 === Bugfixes
2  aruba.gemspec
@@ -2,7 +2,7 @@
2 2
3 3 Gem::Specification.new do |s|
4 4 s.name = 'aruba'
5   - s.version = '0.3.0'
  5 + s.version = '0.3.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}"
30 features/output.feature
@@ -39,7 +39,11 @@ Feature: Output
39 39
40 40 Scenario: Detect exact one-line output
41 41 When I run "ruby -e 'puts \"hello world\"'"
42   - Then the output should contain exactly "hello world\n"
  42 + Then the output should contain exactly:
  43 + """
  44 + hello world
  45 +
  46 + """
43 47
44 48 Scenario: Detect exact multiline output
45 49 When I run "ruby -e 'puts "hello\nworld"'"
@@ -150,15 +154,31 @@ Feature: Output
150 154 When I run "ruby -e 'puts \"hello world!\"'"
151 155 And I run "ruby -e 'puts gets.chomp.reverse'" interactively
152 156 And I type "hello"
153   - Then the stdout should contain "hello world!\nolleh"
154   - And the stderr should not contain "hello world!\nolleh"
  157 + Then the stdout should contain:
  158 + """
  159 + hello world!
  160 + olleh
  161 + """
  162 + And the stderr should not contain:
  163 + """
  164 + hello world!
  165 + olleh
  166 + """
155 167
156 168 Scenario: Detect stderr from all processes
157 169 When I run "ruby -e 'STDERR.puts \"hello world!\"'"
158 170 And I run "ruby -e 'STDERR.puts gets.chomp.reverse'" interactively
159 171 And I type "hello"
160   - Then the stderr should contain "hello world!\nolleh"
161   - And the stdout should not contain "hello world!\nolleh"
  172 + Then the stderr should contain:
  173 + """
  174 + hello world!
  175 + olleh
  176 + """
  177 + And the stdout should not contain:
  178 + """
  179 + hello world!
  180 + olleh
  181 + """
162 182
163 183 Scenario: Detect output from named source
164 184 When I run "ruby -e 'puts :simple'"
35 lib/aruba/api.rb
@@ -22,7 +22,15 @@ def dirs
22 22 @dirs ||= ['tmp/aruba']
23 23 end
24 24
25   - def create_file(file_name, file_content, check_presence = false)
  25 + def write_file(file_name, file_content)
  26 + _create_file(file_name, file_content, false)
  27 + end
  28 +
  29 + def overwrite_file(file_name, file_content)
  30 + _create_file(file_name, file_content, true)
  31 + end
  32 +
  33 + def _create_file(file_name, file_content, check_presence)
26 34 in_current_dir do
27 35 raise "expected #{file_name} to be present" if check_presence && !File.file?(file_name)
28 36 _mkdir(File.dirname(file_name))
@@ -98,8 +106,7 @@ def _mkdir(dir_name)
98 106 end
99 107
100 108 def unescape(string)
101   - string.gsub('\n', "\n")
102   - .gsub('\"', '"')
  109 + string.gsub('\n', "\n").gsub('\"', '"')
103 110 end
104 111
105 112 def regexp(string_or_regexp)
@@ -171,14 +178,6 @@ def assert_exiting_with(expect_to_pass)
171 178 end
172 179 end
173 180
174   - def install_gems(gemfile)
175   - create_file("Gemfile", gemfile)
176   - if ENV['GOTGEMS'].nil?
177   - run("gem install bundler")
178   - run("bundle --no-color install")
179   - end
180   - end
181   -
182 181 def processes
183 182 @processes ||= {}
184 183 end
@@ -234,10 +233,18 @@ def run_interactive(cmd)
234 233 @interactive = run(cmd)
235 234 end
236 235
237   - def write_interactive(input)
  236 + def type(input)
  237 + _write_interactive(_ensure_newline(input))
  238 + end
  239 +
  240 + def _write_interactive(input)
238 241 @interactive.stdin.write(input)
239 242 end
240 243
  244 + def _ensure_newline(str)
  245 + str.chomp << "\n"
  246 + end
  247 +
241 248 def announce_or_puts(msg)
242 249 if(@puts)
243 250 puts(msg)
@@ -297,9 +304,5 @@ def restore_env
297 304 def original_env
298 305 @original_env ||= {}
299 306 end
300   -
301   - def ensure_newline(str)
302   - str.chomp << "\n"
303   - end
304 307 end
305 308 end
56 lib/aruba/cucumber.rb
@@ -64,19 +64,19 @@
64 64 end
65 65
66 66 Given /^a file named "([^"]*)" with:$/ do |file_name, file_content|
67   - create_file(file_name, file_content)
  67 + write_file(file_name, file_content)
68 68 end
69 69
70 70 Given /^an empty file named "([^"]*)"$/ do |file_name|
71   - create_file(file_name, "")
  71 + write_file(file_name, "")
72 72 end
73 73
74 74 When /^I write to "([^"]*)" with:$/ do |file_name, file_content|
75   - create_file(file_name, file_content, false)
  75 + write_file(file_name, file_content)
76 76 end
77 77
78 78 When /^I overwrite "([^"]*)" with:$/ do |file_name, file_content|
79   - create_file(file_name, file_content, true)
  79 + overwrite_file(file_name, file_content, true)
80 80 end
81 81
82 82 When /^I append to "([^"]*)" with:$/ do |file_name, file_content|
@@ -104,39 +104,39 @@
104 104 end
105 105
106 106 When /^I type "([^"]*)"$/ do |input|
107   - write_interactive(ensure_newline(input))
  107 + type(input)
108 108 end
109 109
110 110 Then /^the output should contain "([^"]*)"$/ do |partial_output|
111   - assert_partial_output(unescape(partial_output))
  111 + assert_partial_output(partial_output)
112 112 end
113 113
114 114 Then /^the output from "([^"]*)" should contain "([^"]*)"$/ do |cmd, partial_output|
115   - output_from(cmd).should include(unescape(partial_output))
  115 + output_from(cmd).should include(partial_output)
116 116 end
117 117
118 118 Then /^the output from "([^"]*)" should not contain "([^"]*)"$/ do |cmd, partial_output|
119   - output_from(cmd).should_not include(unescape(partial_output))
  119 + output_from(cmd).should_not include(partial_output)
120 120 end
121 121
122 122 Then /^the output should not contain "([^"]*)"$/ do |partial_output|
123   - all_output.should_not include(unescape(partial_output))
  123 + all_output.should_not include(partial_output)
124 124 end
125 125
126 126 Then /^the output should contain:$/ do |partial_output|
127   - all_output.should include(unescape(partial_output))
  127 + all_output.should include(partial_output)
128 128 end
129 129
130 130 Then /^the output should not contain:$/ do |partial_output|
131   - all_output.should_not include(unescape(partial_output))
  131 + all_output.should_not include(partial_output)
132 132 end
133 133
134 134 Then /^the output should contain exactly "([^"]*)"$/ do |exact_output|
135   - all_output.should == unescape(exact_output)
  135 + all_output.should == exact_output
136 136 end
137 137
138 138 Then /^the output should contain exactly:$/ do |exact_output|
139   - all_output.should == unescape(exact_output)
  139 + all_output.should == exact_output
140 140 end
141 141
142 142 # "the output should match" allows regex in the partial_output, if
@@ -177,7 +177,11 @@
177 177 end
178 178
179 179 Then /^the stderr should contain "([^"]*)"$/ do |partial_output|
180   - all_stderr.should include(unescape(partial_output))
  180 + all_stderr.should include(partial_output)
  181 +end
  182 +
  183 +Then /^the stderr should contain:$/ do |partial_output|
  184 + all_stderr.should include(partial_output)
181 185 end
182 186
183 187 Then /^the stderr should contain exactly:$/ do |exact_output|
@@ -185,11 +189,11 @@
185 189 end
186 190
187 191 Then /^the stdout should contain "([^"]*)"$/ do |partial_output|
188   - all_stdout.should include(unescape(partial_output))
  192 + all_stdout.should include(partial_output)
189 193 end
190 194
191 195 Then /^the stdout should contain:$/ do |partial_output|
192   - all_stdout.should include(unescape(partial_output))
  196 + all_stdout.should include(partial_output)
193 197 end
194 198
195 199 Then /^the stdout should contain exactly:$/ do |exact_output|
@@ -197,27 +201,35 @@
197 201 end
198 202
199 203 Then /^the stderr should not contain "([^"]*)"$/ do |partial_output|
200   - all_stderr.should_not include(unescape(partial_output))
  204 + all_stderr.should_not include(partial_output)
  205 +end
  206 +
  207 +Then /^the stderr should not contain:$/ do |partial_output|
  208 + all_stderr.should_not include(partial_output)
201 209 end
202 210
203 211 Then /^the stdout should not contain "([^"]*)"$/ do |partial_output|
204   - all_stdout.should_not include(unescape(partial_output))
  212 + all_stdout.should_not include(partial_output)
  213 +end
  214 +
  215 +Then /^the stdout should not contain:$/ do |partial_output|
  216 + all_stdout.should_not include(partial_output)
205 217 end
206 218
207 219 Then /^the stdout from "([^"]*)" should contain "([^"]*)"$/ do |cmd, partial_output|
208   - stdout_from(cmd).should include(unescape(partial_output))
  220 + stdout_from(cmd).should include(partial_output)
209 221 end
210 222
211 223 Then /^the stdout from "([^"]*)" should not contain "([^"]*)"$/ do |cmd, partial_output|
212   - stdout_from(cmd).should_not include(unescape(partial_output))
  224 + stdout_from(cmd).should_not include(partial_output)
213 225 end
214 226
215 227 Then /^the stderr from "([^"]*)" should contain "([^"]*)"$/ do |cmd, partial_output|
216   - stderr_from(cmd).should include(unescape(partial_output))
  228 + stderr_from(cmd).should include(partial_output)
217 229 end
218 230
219 231 Then /^the stderr from "([^"]*)" should not contain "([^"]*)"$/ do |cmd, partial_output|
220   - stderr_from(cmd).should_not include(unescape(partial_output))
  232 + stderr_from(cmd).should_not include(partial_output)
221 233 end
222 234
223 235 Then /^the file "([^"]*)" should not exist$/ do |file_name|

No commit comments for this range

Something went wrong with that request. Please try again.