aruba 0.1.3 → 0.1.4

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.4
2
+ * New step definition for appending to a file (Aslak Hellesøy)
3
+
1
4
  == 0.1.3
2
5
  * New step definition for cd (change directory) (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.3"
7
+ gem.version = "0.1.4"
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}
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.3"
8
+ s.version = "0.1.4"
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"]
@@ -9,7 +9,7 @@ Feature: file system commands
9
9
  When I run "ruby -e \"puts test ?d, 'foo'\""
10
10
  Then the stdout should contain "true"
11
11
 
12
- Scenario: cat a file
12
+ Scenario: create a file
13
13
  Given a file named "foo/bar/example.rb" with:
14
14
  """
15
15
  puts "hello world"
@@ -17,6 +17,19 @@ 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: append to a file
21
+ Given a file named "foo/bar/example.rb" with:
22
+ """
23
+ puts "hello world"
24
+ """
25
+ When I append to "foo/bar/example.rb" with:
26
+ """
27
+ puts "this was appended"
28
+ """
29
+ When I run "ruby foo/bar/example.rb"
30
+ Then I should see "hello world"
31
+ And I should see "this was appended"
32
+
20
33
  Scenario: clean up files generated in previous scenario
21
34
  When I run "ruby foo/bar/example.rb"
22
35
  Then the exit status should be 1
data/lib/aruba/api.rb CHANGED
@@ -27,6 +27,12 @@ module Api
27
27
  end
28
28
  end
29
29
 
30
+ def append_to_file(file_name, file_content)
31
+ in_current_dir do
32
+ File.open(file_name, 'a') { |f| f << file_content }
33
+ end
34
+ end
35
+
30
36
  def create_dir(dir_name)
31
37
  in_current_dir do
32
38
  _mkdir(dir_name)
@@ -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 append to "([^\"]*)" with:$/ do |file_name, file_content|
18
+ append_to_file(file_name, file_content)
19
+ end
20
+
17
21
  When /^I cd to "([^\"]*)"$/ do |dir|
18
22
  cd(dir)
19
23
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 3
9
- version: 0.1.3
8
+ - 4
9
+ version: 0.1.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Aslak Helles\xC3\xB8y"