aruba 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ == In Git
2
+
3
+ === New Features
4
+ * 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)
5
+
1
6
  == 0.2.7
2
7
 
3
8
  === New Features
@@ -9,7 +9,7 @@ a compiled C program, a Java program, a Perl script - anything.
9
9
 
10
10
  Then, just require the library in one of your ruby files under <tt>features/support</tt>
11
11
 
12
- require 'aruba'
12
+ require 'aruba/cucumber'
13
13
 
14
14
  You now have a bunch of step definitions that you can use in your features. Look at aruba/cucumber.rb
15
15
  to see all the step definitions. Look at features/*.feature for examples (which are also testing Aruba
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'aruba'
5
- s.version = '0.2.7'
5
+ s.version = '0.2.8'
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}"
@@ -10,8 +10,8 @@ Gem::Specification.new do |s|
10
10
  s.homepage = 'http://github.com/aslakhellesoy/aruba'
11
11
 
12
12
  s.add_dependency 'cucumber', '~> 0.10.0'
13
- s.add_dependency 'background_process' # Can't specify a version - bundler/rubygems chokes on '2.1'
14
- s.add_development_dependency 'rspec', '~> 2.0.1'
13
+ s.add_dependency 'childprocess', '~> 0.1.6'
14
+ s.add_dependency 'rspec', '~> 2.3.0'
15
15
 
16
16
  s.rubygems_version = "1.3.7"
17
17
  s.files = `git ls-files`.split("\n")
@@ -8,7 +8,7 @@ Feature: Output
8
8
  When I run "neverever gonna work"
9
9
  Then the output should contain:
10
10
  """
11
- No such file or directory - neverever gonna work
11
+ No such file or directory - neverever
12
12
  """
13
13
 
14
14
  Scenario: Detect subset of one-line output
@@ -1,15 +1,4 @@
1
1
  $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
2
2
  require 'aruba/cucumber'
3
3
  require 'fileutils'
4
-
5
- begin
6
- # rspec-2
7
- require 'rspec/expectations'
8
- rescue LoadError
9
- # rspec-1
10
- require 'spec/expectations'
11
- end
12
-
13
- Before do
14
- FileUtils.rm(Dir['config/*.yml'])
15
- end
4
+ require 'rspec/expectations'
@@ -210,9 +210,11 @@ module Aruba
210
210
 
211
211
  def run_simple(cmd, fail_on_error=true)
212
212
  @last_exit_status = run(cmd) do |process|
213
+ process.stop
213
214
  announce_or_puts(process.stdout) if @announce_stdout
214
215
  announce_or_puts(process.stderr) if @announce_stderr
215
- process.stop
216
+ # need to replace with process.exit_code or similar, or remove the block entirely... it doesn't add as much as I thought it would
217
+ process.stop
216
218
  end
217
219
  @timed_out = @last_exit_status.nil?
218
220
 
@@ -1,19 +1,29 @@
1
- require 'background_process'
1
+ require 'childprocess'
2
+ require 'tempfile'
3
+ require 'shellwords'
2
4
 
3
5
  module Aruba
4
6
  class Process
7
+ include Shellwords
8
+
5
9
  def initialize(cmd, timeout)
6
- @cmd = cmd
7
10
  @timeout = timeout
11
+ @out = Tempfile.new("aruba-out")
12
+ @err = Tempfile.new("aruba-err")
13
+ @process = ChildProcess.build(*shellwords(cmd))
14
+ @process.io.stdout = @out
15
+ @process.io.stderr = @err
16
+ @process.duplex = true
8
17
  end
9
18
 
10
19
  def run!(&block)
11
- @process = BackgroundProcess.run(@cmd)
20
+ @process.start
12
21
  yield self if block_given?
13
22
  end
14
23
 
15
24
  def stdin
16
- @process.stdin
25
+ sleep 0.1
26
+ @process.io.stdin
17
27
  end
18
28
 
19
29
  def output
@@ -21,26 +31,22 @@ module Aruba
21
31
  end
22
32
 
23
33
  def stdout
24
- if @process
25
- @stdout ||= @process.stdout.read
26
- else
27
- ''
28
- end
34
+ sleep 0.1
35
+ @out.rewind
36
+ @out.read
29
37
  end
30
38
 
31
39
  def stderr
32
- if @process
33
- @stderr ||= @process.stderr.read
34
- else
35
- ''
36
- end
40
+ sleep 0.1
41
+ @err.rewind
42
+ @err.read
37
43
  end
38
44
 
39
45
  def stop
40
46
  if @process
41
47
  stdout && stderr # flush output
42
- status = @process.wait(@timeout)
43
- status && status.exitstatus
48
+ @process.poll_for_exit(@timeout)
49
+ @process.exit_code
44
50
  end
45
51
  end
46
52
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 7
9
- version: 0.2.7
8
+ - 8
9
+ version: 0.2.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Aslak Helles\xC3\xB8y"
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-12-07 00:00:00 +00:00
19
+ date: 2010-12-26 00:00:00 -06:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -35,15 +35,17 @@ dependencies:
35
35
  prerelease: false
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency
38
- name: background_process
38
+ name: childprocess
39
39
  requirement: &id002 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
- - - ">="
42
+ - - ~>
43
43
  - !ruby/object:Gem::Version
44
44
  segments:
45
45
  - 0
46
- version: "0"
46
+ - 1
47
+ - 6
48
+ version: 0.1.6
47
49
  type: :runtime
48
50
  prerelease: false
49
51
  version_requirements: *id002
@@ -56,10 +58,10 @@ dependencies:
56
58
  - !ruby/object:Gem::Version
57
59
  segments:
58
60
  - 2
61
+ - 3
59
62
  - 0
60
- - 1
61
- version: 2.0.1
62
- type: :development
63
+ version: 2.3.0
64
+ type: :runtime
63
65
  prerelease: false
64
66
  version_requirements: *id003
65
67
  description: CLI Steps for Cucumber, hand-crafted for you in Aruba
@@ -110,7 +112,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
112
  requirements:
111
113
  - - ">="
112
114
  - !ruby/object:Gem::Version
113
- hash: 4224427538675420032
115
+ hash: -4095997037921119441
114
116
  segments:
115
117
  - 0
116
118
  version: "0"
@@ -119,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
121
  requirements:
120
122
  - - ">="
121
123
  - !ruby/object:Gem::Version
122
- hash: 4224427538675420032
124
+ hash: -4095997037921119441
123
125
  segments:
124
126
  - 0
125
127
  version: "0"
@@ -129,7 +131,7 @@ rubyforge_project:
129
131
  rubygems_version: 1.3.7
130
132
  signing_key:
131
133
  specification_version: 3
132
- summary: aruba-0.2.7
134
+ summary: aruba-0.2.8
133
135
  test_files:
134
136
  - features/exit_statuses.feature
135
137
  - features/file_system_commands.feature