bahia 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ == 0.7.2
2
+ * Add acceptance spec
3
+ * Really, it works on 1.8.7 now
4
+
1
5
  == 0.7.1
2
6
  * Actually work in 1.8.7
3
7
 
@@ -2,7 +2,7 @@ require 'open3'
2
2
  require 'shellwords'
3
3
 
4
4
  module Bahia
5
- VERSION = '0.7.1'
5
+ VERSION = '0.7.2'
6
6
 
7
7
  class DetectionError < StandardError
8
8
  def initialize(name)
@@ -37,7 +37,7 @@ module Bahia
37
37
  end
38
38
 
39
39
  def self.exec_command(*args)
40
- unless RUBY_DESCRIPTION[/rubinius/] || RUBY_DESCRIPTION[/jruby/]
40
+ unless RUBY_DESCRIPTION[/rubinius|jruby|ruby 1\.8\.7/]
41
41
  return Open3.capture3(*args)
42
42
  end
43
43
 
@@ -0,0 +1,47 @@
1
+ require 'fileutils'
2
+ require 'bahia'
3
+ require 'rspec'
4
+
5
+ describe "Acceptance test Bahia" do
6
+ def run_command(cmd='')
7
+ @stdout, @stderr, @process = Bahia.run_command(cmd)
8
+ end
9
+
10
+ before(:all) do
11
+ dir = File.dirname(__FILE__) + '/tmpdir'
12
+ FileUtils.mkdir_p("#{dir}/bin")
13
+ executable = "#{dir}/bin/zzzz"
14
+ File.open(executable, 'w') do |f|
15
+ f.write <<-STR.gsub(/^\s*/, '')
16
+ #!/usr/bin/env ruby
17
+ if ARGV[0]
18
+ warn "I'm sleeping!"
19
+ else
20
+ puts "ZZZZZ"
21
+ end
22
+ STR
23
+ end
24
+ FileUtils.chmod 0755, executable
25
+ Bahia.project_directory = dir
26
+ Bahia.command = executable
27
+ end
28
+ after(:all) { FileUtils.rm_rf File.dirname(__FILE__) + '/tmpdir' }
29
+ at_exit { FileUtils.rm_rf File.dirname(__FILE__) + '/tmpdir' }
30
+
31
+ it "detects stdout" do
32
+ run_command
33
+ @stdout.should =~ /^ZZZZZ/
34
+ end
35
+
36
+ it "detects stderr" do
37
+ run_command "hello"
38
+ @stderr.should =~ /^I'm sleeping!/
39
+ end
40
+
41
+ unless RUBY_DESCRIPTION[/jruby/]
42
+ it "detects stdout" do
43
+ run_command
44
+ @process.class.should == Process::Status
45
+ end
46
+ end
47
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bahia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-06 00:00:00.000000000 Z
12
+ date: 2012-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: open4
16
- requirement: &70228386398440 !ruby/object:Gem::Requirement
16
+ requirement: &70164230575980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.3.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70228386398440
24
+ version_requirements: *70164230575980
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70228386397960 !ruby/object:Gem::Requirement
27
+ requirement: &70164230565280 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 2.8.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70228386397960
35
+ version_requirements: *70164230565280
36
36
  description: Bahia - where commandline acceptance tests are easy, the people are festive
37
37
  and onde nasceu capoeira. In other words, aruba for any non-cucumber test framework.
38
38
  email: gabriel.horner@gmail.com
@@ -43,6 +43,7 @@ extra_rdoc_files:
43
43
  - LICENSE.txt
44
44
  files:
45
45
  - lib/bahia.rb
46
+ - spec/acceptance_spec.rb
46
47
  - spec/bahia_spec.rb
47
48
  - README.md
48
49
  - LICENSE.txt