aruba 0.4.6 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -22,3 +22,4 @@ pkg
22
22
  tmp
23
23
  .bundle
24
24
  doc
25
+ Gemfile.lock
@@ -0,0 +1,4 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - 1.9.3
data/History.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [v0.4.7](https://github.com/cucumber/aruba/compare/v0.4.6...v0.4.7)
2
+
3
+ * Remove rdiscount dependency. (#85 Aslak Hellesøy)
4
+ * Pin to ffi 1.0.9 since 1.0.10 is broken. (Aslak Hellesøy)
5
+ * Added file size specific steps to the Aruba API. (#89 Hector Castro)
6
+
1
7
  ## [v0.4.6](https://github.com/cucumber/aruba/compare/v0.4.5...v0.4.6)
2
8
 
3
9
  * Upgraded deps to latest gems. (Aslak Hellesøy)
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://secure.travis-ci.org/cucumber/aruba.png)](http://travis-ci.org/cucumber/aruba)
2
+
1
3
  Aruba is Cucumber extension for Command line applications written in any programming language. Features at a glance:
2
4
 
3
5
  * Test any command line application
data/Rakefile CHANGED
@@ -7,7 +7,9 @@ Bundler::GemHelper.install_tasks
7
7
  require 'cucumber/rake/task'
8
8
 
9
9
  Cucumber::Rake::Task.new do |t|
10
- t.cucumber_opts = %w{--tags ~@jruby} unless defined?(JRUBY_VERSION)
10
+ opts = defined?(JRUBY_VERSION) ? %w{--tags ~@jruby} : []
11
+ opts += %w{--tags ~@fails-on-travis} if ENV['TRAVIS']
12
+ t.cucumber_opts = opts
11
13
  end
12
14
 
13
15
  task :default => :cucumber
@@ -2,18 +2,19 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'aruba'
5
- s.version = '0.4.6'
5
+ s.version = '0.4.7'
6
6
  s.authors = ["Aslak Hellesøy", "David Chelimsky", "Mike Sassak", "Matt Wynne"]
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/cucumber/aruba'
11
11
 
12
- s.add_dependency 'cucumber', '>= 1.0.2'
13
- s.add_dependency 'childprocess', '>= 0.2.0'
14
- s.add_dependency 'rspec', '>= 2.6.0'
15
- s.add_dependency 'bcat', '>= 0.6.1'
16
- s.add_dependency 'rdiscount', '>= 1.6.8'
12
+ s.add_runtime_dependency 'cucumber', '>= 1.1.1'
13
+ s.add_runtime_dependency 'childprocess', '>= 0.2.2'
14
+ s.add_runtime_dependency 'ffi', '1.0.9' # https://github.com/ffi/ffi/issues/176
15
+ s.add_runtime_dependency 'rspec', '>= 2.7.0'
16
+ s.add_development_dependency 'bcat', '>= 0.6.1'
17
+ s.add_development_dependency 'rdiscount', '>= 1.6.8'
17
18
  s.add_development_dependency 'rake', '>= 0.9.2'
18
19
 
19
20
  s.rubygems_version = ">= 1.6.1"
@@ -31,10 +31,12 @@ Feature: exit statuses
31
31
  When I do aruba I successfully run `ruby -e 'exit 10'`
32
32
  Then aruba should fail with "Exit status was 10"
33
33
 
34
+ @posix
34
35
  Scenario: Try to run something that doesn't exist
35
36
  When I run `does_not_exist`
36
37
  Then the exit status should be 1
37
38
 
39
+ @posix
38
40
  Scenario: Try to run something that doesn't exist with `
39
41
  When I run `does_not_exist`
40
42
  Then the exit status should be 1
@@ -17,6 +17,10 @@ Feature: file system commands
17
17
  When I run `ruby foo/bar/example.rb`
18
18
  Then the output should contain "hello world"
19
19
 
20
+ Scenario: create a fixed sized file
21
+ Given a 1048576 byte file named "test.txt"
22
+ Then a 1048576 byte file named "test.txt" should exist
23
+
20
24
  Scenario: Append to a file
21
25
  \### We like appending to files:
22
26
  1. Disk space is cheap
@@ -20,6 +20,7 @@ Feature: Interactive process control
20
20
  dlrow ,olleh
21
21
  """
22
22
 
23
+ @posix @fails-on-travis
23
24
  Scenario: Running a native binary interactively
24
25
  When I run `bc -q` interactively
25
26
  And I type "4 + 3"
@@ -29,6 +30,7 @@ Feature: Interactive process control
29
30
  7
30
31
  """
31
32
 
33
+ @posix
32
34
  Scenario: Stop processes before checking for filesystem changes
33
35
  See: http://github.com/aslakhellesoy/aruba/issues#issue/17 for context
34
36
 
@@ -4,6 +4,7 @@ Feature: Output
4
4
  As a developer using Cucumber
5
5
  I want to use the "the output should contain" step
6
6
 
7
+ @posix
7
8
  Scenario: Run unknown command
8
9
  When I run `neverever gonna work`
9
10
  Then the output should contain:
@@ -11,10 +12,12 @@ Feature: Output
11
12
  No such file or directory - neverever
12
13
  """
13
14
 
15
+ @posix
14
16
  Scenario: Detect subset of one-line output
15
17
  When I run `ruby -e 'puts \"hello world\"'`
16
18
  Then the output should contain "hello world"
17
19
 
20
+ @posix
18
21
  Scenario: Detect subset of one-line output
19
22
  When I run `echo 'hello world'`
20
23
  Then the output should contain "hello world"
@@ -37,6 +40,7 @@ Feature: Output
37
40
  good-bye
38
41
  """
39
42
 
43
+ @posix
40
44
  Scenario: Detect exact one-line output
41
45
  When I run `ruby -e 'puts \"hello world\"'`
42
46
  Then the output should contain exactly:
@@ -46,6 +50,7 @@ Feature: Output
46
50
  """
47
51
 
48
52
  @ansi
53
+ @posix
49
54
  Scenario: Detect exact one-line output with ANSI output
50
55
  When I run `ruby -e 'puts \"\e[36mhello world\e[0m\"'`
51
56
  Then the output should contain exactly:
@@ -54,6 +59,7 @@ Feature: Output
54
59
 
55
60
  """
56
61
 
62
+ @posix
57
63
  Scenario: Detect exact one-line output with ANSI output stripped by default
58
64
  When I run `ruby -e 'puts \"\e[36mhello world\e[0m\"'`
59
65
  Then the output should contain exactly:
@@ -61,7 +67,7 @@ Feature: Output
61
67
  hello world
62
68
 
63
69
  """
64
-
70
+ @posix
65
71
  Scenario: Detect exact multiline output
66
72
  When I run `ruby -e 'puts "hello\nworld"'`
67
73
  Then the output should contain exactly:
@@ -75,9 +81,10 @@ Feature: Output
75
81
  Scenario: Detect subset of one-line output with regex
76
82
  When I run `ruby --version`
77
83
  Then the output should contain "ruby"
78
- And the output should match /ruby ([\d]+\.[\d]+\.[\d]+)(p\d+)? \(.*$/
84
+ And the output should match /ruby ([\d]+\.[\d]+\.[\d]+)(\w*\d*)? \(.*$/
79
85
 
80
86
  @announce
87
+ @posix
81
88
  Scenario: Detect subset of multiline output with regex
82
89
  When I run `ruby -e 'puts "hello\nworld\nextra line1\nextra line2\nimportant line"'`
83
90
  Then the output should match:
@@ -89,6 +96,7 @@ Feature: Output
89
96
  """
90
97
 
91
98
  @announce
99
+ @posix
92
100
  Scenario: Match passing exit status and partial output
93
101
  When I run `ruby -e 'puts "hello\nworld"'`
94
102
  Then it should pass with:
@@ -96,6 +104,7 @@ Feature: Output
96
104
  hello
97
105
  """
98
106
 
107
+ @posix
99
108
  Scenario: Match passing exit status and exact output
100
109
  When I run `ruby -e 'puts "hello\nworld"'`
101
110
  Then it should pass with exactly:
@@ -113,6 +122,7 @@ Feature: Output
113
122
  hello
114
123
  """
115
124
 
125
+ @posix
116
126
  Scenario: Match failing exit status and exact output
117
127
  When I run `ruby -e 'puts "hello\nworld";exit 99'`
118
128
  Then it should fail with exactly:
@@ -123,6 +133,7 @@ Feature: Output
123
133
  """
124
134
 
125
135
  @announce-stdout
136
+ @posix
126
137
  Scenario: Match failing exit status and output with regex
127
138
  When I run `ruby -e 'puts \"hello\\nworld\";exit 99'`
128
139
  Then it should fail with regex:
@@ -131,6 +142,7 @@ Feature: Output
131
142
  """
132
143
 
133
144
  @announce-cmd
145
+ @posix
134
146
  Scenario: Match output in stdout
135
147
  When I run `ruby -e 'puts \"hello\\nworld\"'`
136
148
  Then the stdout should contain "hello"
@@ -144,6 +156,7 @@ Feature: Output
144
156
  GET /
145
157
  """
146
158
 
159
+ @posix
147
160
  Scenario: Match output on several lines using quotes
148
161
  When I run `ruby -e 'puts %{GET "/"}'`
149
162
  Then the stdout should contain:
@@ -151,11 +164,14 @@ Feature: Output
151
164
  GET "/"
152
165
  """
153
166
 
167
+ @posix
154
168
  Scenario: Match output in stdout
155
169
  When I run `ruby -e 'puts \"hello\\nworld\"'`
156
170
  Then the stdout should contain "hello"
157
171
  Then the stderr should not contain "hello"
158
172
 
173
+
174
+ @posix
159
175
  Scenario: Detect output from all processes
160
176
  When I run `ruby -e 'puts \"hello world!\"'`
161
177
  And I run `ruby -e 'puts gets.chomp.reverse'` interactively
@@ -167,6 +183,7 @@ Feature: Output
167
183
 
168
184
  """
169
185
 
186
+ @posix
170
187
  Scenario: Detect stdout from all processes
171
188
  When I run `ruby -e 'puts \"hello world!\"'`
172
189
  And I run `ruby -e 'puts gets.chomp.reverse'` interactively
@@ -182,6 +199,7 @@ Feature: Output
182
199
  olleh
183
200
  """
184
201
 
202
+ @posix
185
203
  Scenario: Detect stderr from all processes
186
204
  When I run `ruby -e 'STDERR.puts \"hello world!\"'`
187
205
  And I run `ruby -e 'STDERR.puts gets.chomp.reverse'` interactively
@@ -222,9 +240,9 @@ Feature: Output
222
240
  Scenario: Detect output from named source with custom name
223
241
 
224
242
  Scenario: Detect second output from named source with custom name
225
- When I set env varibable "ARUBA_TEST_VAR" to "first"
243
+ When I set env variable "ARUBA_TEST_VAR" to "first"
226
244
  And I run `ruby -e 'puts ENV[%q(ARUBA_TEST_VAR)]'`
227
245
  Then the output from "ruby -e 'puts ENV[%q(ARUBA_TEST_VAR)]'" should contain "first"
228
- When I set env varibable "ARUBA_TEST_VAR" to "second"
246
+ When I set env variable "ARUBA_TEST_VAR" to "second"
229
247
  And I run `ruby -e 'puts ENV[%q(ARUBA_TEST_VAR)]'`
230
248
  Then the output from "ruby -e 'puts ENV[%q(ARUBA_TEST_VAR)]'" should contain "second"
@@ -1,6 +1,6 @@
1
1
  When /^I do aruba (.*)$/ do |aruba_step|
2
2
  begin
3
- When(aruba_step)
3
+ step(aruba_step)
4
4
  rescue => e
5
5
  @aruba_exception = e
6
6
  end
@@ -11,7 +11,7 @@ When /^sleep (\d+)$/ do |time|
11
11
  sleep time.to_i
12
12
  end
13
13
 
14
- When /^I set env varibable "(\w+)" to "([^"]*)"$/ do |var, value|
14
+ When /^I set env variable "(\w+)" to "([^"]*)"$/ do |var, value|
15
15
  ENV[var] = value
16
16
  end
17
17
 
@@ -26,6 +26,10 @@ module Aruba
26
26
  _create_file(file_name, file_content, false)
27
27
  end
28
28
 
29
+ def write_fixed_size_file(file_name, file_size)
30
+ _create_fixed_size_file(file_name, file_size, false)
31
+ end
32
+
29
33
  def overwrite_file(file_name, file_content)
30
34
  _create_file(file_name, file_content, true)
31
35
  end
@@ -38,6 +42,14 @@ module Aruba
38
42
  end
39
43
  end
40
44
 
45
+ def _create_fixed_size_file(file_name, file_size, check_presence)
46
+ in_current_dir do
47
+ raise "expected #{file_name} to be present" if check_presence && !File.file?(file_name)
48
+ _mkdir(File.dirname(file_name))
49
+ File.open(file_name, "wb"){ |f| f.seek(file_size - 1); f.write("\0") }
50
+ end
51
+ end
52
+
41
53
  def remove_file(file_name)
42
54
  in_current_dir do
43
55
  FileUtils.rm(file_name)
@@ -69,6 +81,14 @@ module Aruba
69
81
  end
70
82
  end
71
83
 
84
+ def check_file_size(paths_and_sizes)
85
+ prep_for_fs_check do
86
+ paths_and_sizes.each do |path, size|
87
+ File.size(path).should == size
88
+ end
89
+ end
90
+ end
91
+
72
92
  def check_file_content(file, partial_content, expect_match)
73
93
  regexp = regexp(partial_content)
74
94
  prep_for_fs_check do
@@ -16,6 +16,10 @@ Given /^a file named "([^"]*)" with:$/ do |file_name, file_content|
16
16
  write_file(file_name, file_content)
17
17
  end
18
18
 
19
+ Given /^a (\d+) byte file named "([^"]*)"$/ do |file_size, file_name|
20
+ write_fixed_size_file(file_name, file_size.to_i)
21
+ end
22
+
19
23
  Given /^an empty file named "([^"]*)"$/ do |file_name|
20
24
  write_file(file_name, "")
21
25
  end
@@ -216,6 +220,10 @@ Then /^a file named "([^"]*)" should not exist$/ do |file|
216
220
  check_file_presence([file], false)
217
221
  end
218
222
 
223
+ Then /^a (\d+) byte file named "([^"]*)" should exist$/ do |file_size, file_name|
224
+ check_file_size([[file_name, file_size.to_i]])
225
+ end
226
+
219
227
  Then /^the following directories should exist:$/ do |directories|
220
228
  check_directory_presence(directories.raw.map{|directory_row| directory_row[0]}, true)
221
229
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aruba
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,67 +12,77 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2011-08-08 00:00:00.000000000 +01:00
16
- default_executable:
15
+ date: 2011-11-09 00:00:00.000000000 Z
17
16
  dependencies:
18
17
  - !ruby/object:Gem::Dependency
19
18
  name: cucumber
20
- requirement: &2168642440 !ruby/object:Gem::Requirement
19
+ requirement: &2169217200 !ruby/object:Gem::Requirement
21
20
  none: false
22
21
  requirements:
23
22
  - - ! '>='
24
23
  - !ruby/object:Gem::Version
25
- version: 1.0.2
24
+ version: 1.1.1
26
25
  type: :runtime
27
26
  prerelease: false
28
- version_requirements: *2168642440
27
+ version_requirements: *2169217200
29
28
  - !ruby/object:Gem::Dependency
30
29
  name: childprocess
31
- requirement: &2168641700 !ruby/object:Gem::Requirement
30
+ requirement: &2169216360 !ruby/object:Gem::Requirement
32
31
  none: false
33
32
  requirements:
34
33
  - - ! '>='
35
34
  - !ruby/object:Gem::Version
36
- version: 0.2.0
35
+ version: 0.2.2
37
36
  type: :runtime
38
37
  prerelease: false
39
- version_requirements: *2168641700
38
+ version_requirements: *2169216360
39
+ - !ruby/object:Gem::Dependency
40
+ name: ffi
41
+ requirement: &2169215480 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - =
45
+ - !ruby/object:Gem::Version
46
+ version: 1.0.9
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: *2169215480
40
50
  - !ruby/object:Gem::Dependency
41
51
  name: rspec
42
- requirement: &2168640920 !ruby/object:Gem::Requirement
52
+ requirement: &2169214760 !ruby/object:Gem::Requirement
43
53
  none: false
44
54
  requirements:
45
55
  - - ! '>='
46
56
  - !ruby/object:Gem::Version
47
- version: 2.6.0
57
+ version: 2.7.0
48
58
  type: :runtime
49
59
  prerelease: false
50
- version_requirements: *2168640920
60
+ version_requirements: *2169214760
51
61
  - !ruby/object:Gem::Dependency
52
62
  name: bcat
53
- requirement: &2168639920 !ruby/object:Gem::Requirement
63
+ requirement: &2169214160 !ruby/object:Gem::Requirement
54
64
  none: false
55
65
  requirements:
56
66
  - - ! '>='
57
67
  - !ruby/object:Gem::Version
58
68
  version: 0.6.1
59
- type: :runtime
69
+ type: :development
60
70
  prerelease: false
61
- version_requirements: *2168639920
71
+ version_requirements: *2169214160
62
72
  - !ruby/object:Gem::Dependency
63
73
  name: rdiscount
64
- requirement: &2168639020 !ruby/object:Gem::Requirement
74
+ requirement: &2169213540 !ruby/object:Gem::Requirement
65
75
  none: false
66
76
  requirements:
67
77
  - - ! '>='
68
78
  - !ruby/object:Gem::Version
69
79
  version: 1.6.8
70
- type: :runtime
80
+ type: :development
71
81
  prerelease: false
72
- version_requirements: *2168639020
82
+ version_requirements: *2169213540
73
83
  - !ruby/object:Gem::Dependency
74
84
  name: rake
75
- requirement: &2168638080 !ruby/object:Gem::Requirement
85
+ requirement: &2169212940 !ruby/object:Gem::Requirement
76
86
  none: false
77
87
  requirements:
78
88
  - - ! '>='
@@ -80,7 +90,7 @@ dependencies:
80
90
  version: 0.9.2
81
91
  type: :development
82
92
  prerelease: false
83
- version_requirements: *2168638080
93
+ version_requirements: *2169212940
84
94
  description: CLI Steps for Cucumber, hand-crafted for you in Aruba
85
95
  email: cukes@googlegroups.com
86
96
  executables: []
@@ -90,8 +100,8 @@ files:
90
100
  - .document
91
101
  - .gitignore
92
102
  - .rvmrc
103
+ - .travis.yml
93
104
  - Gemfile
94
- - Gemfile.lock
95
105
  - History.md
96
106
  - LICENSE
97
107
  - README.md
@@ -126,7 +136,6 @@ files:
126
136
  - templates/js/filesystem.js
127
137
  - templates/js/jquery-1.6.1.min.js
128
138
  - templates/main.erb
129
- has_rdoc: true
130
139
  homepage: http://github.com/cucumber/aruba
131
140
  licenses: []
132
141
  post_install_message:
@@ -142,7 +151,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
151
  version: '0'
143
152
  segments:
144
153
  - 0
145
- hash: 755002132282512509
154
+ hash: -1641933628197378255
146
155
  required_rubygems_version: !ruby/object:Gem::Requirement
147
156
  none: false
148
157
  requirements:
@@ -151,13 +160,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
160
  version: '0'
152
161
  segments:
153
162
  - 0
154
- hash: 755002132282512509
163
+ hash: -1641933628197378255
155
164
  requirements: []
156
165
  rubyforge_project:
157
- rubygems_version: 1.6.2
166
+ rubygems_version: 1.8.10
158
167
  signing_key:
159
168
  specification_version: 3
160
- summary: aruba-0.4.6
169
+ summary: aruba-0.4.7
161
170
  test_files:
162
171
  - features/exit_statuses.feature
163
172
  - features/file_system_commands.feature
@@ -1,48 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- aruba (0.4.6)
5
- bcat (>= 0.6.1)
6
- childprocess (>= 0.2.0)
7
- cucumber (>= 1.0.2)
8
- rdiscount (>= 1.6.8)
9
- rspec (>= 2.6.0)
10
-
11
- GEM
12
- remote: http://rubygems.org/
13
- specs:
14
- bcat (0.6.1)
15
- rack (~> 1.0)
16
- builder (3.0.0)
17
- childprocess (0.2.0)
18
- ffi (~> 1.0.6)
19
- cucumber (1.0.2)
20
- builder (>= 2.1.2)
21
- diff-lcs (>= 1.1.2)
22
- gherkin (~> 2.4.5)
23
- json (>= 1.4.6)
24
- term-ansicolor (>= 1.0.5)
25
- diff-lcs (1.1.2)
26
- ffi (1.0.9)
27
- gherkin (2.4.6)
28
- json (>= 1.4.6)
29
- json (1.5.3)
30
- rack (1.3.2)
31
- rake (0.9.2)
32
- rdiscount (1.6.8)
33
- rspec (2.6.0)
34
- rspec-core (~> 2.6.0)
35
- rspec-expectations (~> 2.6.0)
36
- rspec-mocks (~> 2.6.0)
37
- rspec-core (2.6.4)
38
- rspec-expectations (2.6.0)
39
- diff-lcs (~> 1.1.2)
40
- rspec-mocks (2.6.0)
41
- term-ansicolor (1.0.6)
42
-
43
- PLATFORMS
44
- ruby
45
-
46
- DEPENDENCIES
47
- aruba!
48
- rake (>= 0.9.2)