Skip to content

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.
...
  • 1 commit
  • 6 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jun 20, 2011
@aslakhellesoy aslakhellesoy Release 0.4.2 b5e3382
Showing with 16 additions and 2 deletions.
  1. +1 −1 Gemfile.lock
  2. +4 −0 History.md
  3. +1 −1 aruba.gemspec
  4. +5 −0 features/file_system_commands.feature
  5. +1 −0 lib/aruba/api.rb
  6. +4 −0 lib/aruba/cucumber.rb
View
2 Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- aruba (0.4.1)
+ aruba (0.4.2)
bcat (>= 0.6.1)
childprocess (>= 0.1.9)
cucumber (>= 0.10.7)
View
4 History.md
@@ -1,3 +1,7 @@
+## [v0.4.2](https://github.com/cucumber/aruba/compare/v0.4.1...v0.4.2)
+
+* Appending to a file creates the parent directory if it doesn't exist. (Aslak Hellesøy)
+
## [v0.4.1](https://github.com/cucumber/aruba/compare/v0.4.0...v0.4.1)
* Move more logic into Aruba::Api (Aslak Hellesøy)
View
2 aruba.gemspec
@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = 'aruba'
- s.version = '0.4.1'
+ s.version = '0.4.2'
s.authors = ["Aslak Hellesøy", "David Chelimsky", "Mike Sassak"]
s.description = 'CLI Steps for Cucumber, hand-crafted for you in Aruba'
s.summary = "aruba-#{s.version}"
View
5 features/file_system_commands.feature
@@ -45,6 +45,11 @@ Feature: file system commands
Then the stdout should contain "hello world"
And the stdout should contain "this was appended"
+ Scenario: Append to a new file
+ When I append to "thedir/thefile" with "x"
+ And I append to "thedir/thefile" with "y"
+ Then the file "thedir/thefile" should contain "xy"
+
Scenario: clean up files generated in previous scenario
When I run `ruby foo/bar/example.rb`
Then the exit status should be 1
View
1 lib/aruba/api.rb
@@ -46,6 +46,7 @@ def remove_file(file_name)
def append_to_file(file_name, file_content)
in_current_dir do
+ _mkdir(File.dirname(file_name))
File.open(file_name, 'a') { |f| f << file_content }
end
end
View
4 lib/aruba/cucumber.rb
@@ -32,6 +32,10 @@
append_to_file(file_name, file_content)
end
+When /^I append to "([^"]*)" with "([^"]*)"$/ do |file_name, file_content|
+ append_to_file(file_name, file_content)
+end
+
When /^I remove the file "([^"]*)"$/ do |file_name|
remove_file(file_name)
end

No commit comments for this range

Something went wrong with that request. Please try again.