aruba 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/Rakefile +2 -2
- data/features/output.feature +1 -1
- data/features/running_ruby.feature +16 -9
- data/features/step_definitions/aruba_dev_steps.rb +1 -0
- data/lib/aruba/api.rb +28 -3
- data/lib/aruba/cucumber.rb +9 -7
- metadata +7 -5
data/History.txt
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
== 0.1.8
|
2
|
+
* Use // instead of "" for "I should see matching" step. (Aslak Hellesøy)
|
3
|
+
* Replace rvm gemset character '%' with '@' for rvm 0.1.24 (#5 Ashley Moran)
|
4
|
+
* Support gem bundler, making it easier to specify gems. (Aslak Hellesøy)
|
5
|
+
|
1
6
|
== 0.1.7
|
2
7
|
* New @announce-stderr tag (Robert Wahler)
|
3
8
|
* New "I should see matching" steps using Regexp (Robert Wahler)
|
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ require 'rake'
|
|
5
5
|
begin
|
6
6
|
require 'jeweler'
|
7
7
|
Jeweler::Tasks.new do |gem|
|
8
|
-
gem.version = "0.1.
|
8
|
+
gem.version = "0.1.8"
|
9
9
|
gem.name = "aruba"
|
10
10
|
gem.summary = %Q{CLI Steps for Cucumber}
|
11
11
|
gem.description = %Q{CLI Steps for Cucumber, hand-crafted for you in Aruba}
|
@@ -13,7 +13,7 @@ begin
|
|
13
13
|
gem.homepage = "http://github.com/aslakhellesoy/aruba"
|
14
14
|
gem.authors = ["Aslak Hellesøy", "David Chelimsky"]
|
15
15
|
gem.add_development_dependency "rspec", ">= 1.3.0"
|
16
|
-
gem.add_development_dependency "cucumber", ">= 0.6
|
16
|
+
gem.add_development_dependency "cucumber", ">= 0.7.0.beta.6"
|
17
17
|
end
|
18
18
|
Jeweler::GemcutterTasks.new
|
19
19
|
rescue LoadError
|
data/features/output.feature
CHANGED
@@ -47,7 +47,7 @@ Feature: Output
|
|
47
47
|
Scenario: Detect subset of one-line output with regex
|
48
48
|
When I run "ruby --version"
|
49
49
|
Then I should see "ruby"
|
50
|
-
And I should see matching
|
50
|
+
And I should see matching /ruby ([\d]+\.[\d]+\.[\d]+)(p\d+)? \(.*$/
|
51
51
|
|
52
52
|
@announce
|
53
53
|
Scenario: Detect subset of multiline output with regex
|
@@ -16,18 +16,25 @@ Feature: Running ruby
|
|
16
16
|
Then I should see "1.4.0"
|
17
17
|
And I should not see "rvm usage"
|
18
18
|
|
19
|
-
Scenario:
|
19
|
+
Scenario: Install gems with bundler
|
20
20
|
Given I am using rvm "1.9.1"
|
21
|
-
And I am using rvm gemset "a-gemset-where-
|
21
|
+
And I am using rvm gemset "a-new-gemset-where-no-gems-are-installed" with Gemfile:
|
22
|
+
"""
|
23
|
+
gem 'diff-lcs', '1.1.2'
|
24
|
+
"""
|
22
25
|
When I run "gem list"
|
23
|
-
Then I should see:
|
26
|
+
Then I should see matching:
|
24
27
|
"""
|
25
|
-
|
26
|
-
|
27
|
-
rubygems-update (1.3.5)
|
28
|
-
|
28
|
+
bundler \(\d+\.+\d+\.+\d+\)
|
29
|
+
diff-lcs \(\d+\.+\d+\.+\d+\)
|
29
30
|
"""
|
30
31
|
|
32
|
+
Scenario: Specify both rvm and gemset
|
33
|
+
Given I am using rvm "1.9.1"
|
34
|
+
And I am using an empty rvm gemset "a-new-gemset-where-no-gems-are-installed"
|
35
|
+
When I run "gem list | wc -l"
|
36
|
+
Then I should see exactly " 2\n"
|
37
|
+
|
31
38
|
Scenario: Find the version of ruby 1.9.1
|
32
39
|
Given I am using rvm "1.9.1"
|
33
40
|
When I run "ruby --version"
|
@@ -36,7 +43,7 @@ Feature: Running ruby
|
|
36
43
|
Scenario: Find the version of cucumber on ruby 1.9.1
|
37
44
|
Given I am using rvm "1.9.1"
|
38
45
|
When I run "cucumber --version"
|
39
|
-
Then I should see
|
46
|
+
Then I should see matching /\d+\.+\d+\.+\d+/
|
40
47
|
|
41
48
|
Scenario: Use current ruby
|
42
49
|
When I run "ruby --version"
|
@@ -70,5 +77,5 @@ Feature: Running ruby
|
|
70
77
|
# ~/.rvm/rubies/jruby-1.4.0/bin/jruby -S cucumber features/running_ruby.feature -n "launched Cucumber"
|
71
78
|
@jruby
|
72
79
|
Scenario: Don't use rvm, but default to same Ruby as the one that launched Cucumber
|
73
|
-
When I run "ruby -e 'puts JRUBY_VERSION'"
|
80
|
+
When I run "ruby -e 'puts JRUBY_VERSION if defined?(JRUBY_VERSION)'"
|
74
81
|
Then I should see the JRuby version
|
data/lib/aruba/api.rb
CHANGED
@@ -88,11 +88,31 @@ module Api
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
-
def use_rvm_gemset(rvm_gemset)
|
91
|
+
def use_rvm_gemset(rvm_gemset, empty_gemset)
|
92
92
|
@rvm_gemset = rvm_gemset
|
93
|
+
if empty_gemset
|
94
|
+
delete_rvm_gemset(rvm_gemset)
|
95
|
+
create_rvm_gemset(rvm_gemset)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
def delete_rvm_gemset(rvm_gemset)
|
100
|
+
raise "You haven't specified what ruby version rvm should use." if @rvm_ruby_version.nil?
|
101
|
+
run "rvm --force gemset delete #{@rvm_ruby_version}@#{rvm_gemset}"
|
102
|
+
end
|
103
|
+
|
104
|
+
def create_rvm_gemset(rvm_gemset)
|
105
|
+
raise "You haven't specified what ruby version rvm should use." if @rvm_ruby_version.nil?
|
106
|
+
run "rvm --create #{@rvm_ruby_version}@#{rvm_gemset}"
|
107
|
+
end
|
108
|
+
|
109
|
+
def install_gems(gemfile)
|
110
|
+
create_file("Gemfile", gemfile)
|
111
|
+
run("gem install bundler")
|
112
|
+
run("bundle install")
|
93
113
|
end
|
94
114
|
|
95
|
-
def run(cmd)
|
115
|
+
def run(cmd, fail_on_error=true)
|
96
116
|
cmd = detect_ruby_script(cmd)
|
97
117
|
cmd = detect_ruby(cmd)
|
98
118
|
|
@@ -113,6 +133,11 @@ module Api
|
|
113
133
|
@last_stderr = IO.read(stderr_file.path)
|
114
134
|
|
115
135
|
announce(@last_stderr) if @announce_stderr
|
136
|
+
|
137
|
+
if(@last_exit_status != 0 && fail_on_error)
|
138
|
+
fail("Exit status was #{@last_exit_status}. Output:\n#{combined_output}")
|
139
|
+
end
|
140
|
+
|
116
141
|
@last_stderr
|
117
142
|
end
|
118
143
|
|
@@ -136,7 +161,7 @@ module Api
|
|
136
161
|
|
137
162
|
def current_ruby
|
138
163
|
if @rvm_ruby_version
|
139
|
-
rvm_ruby_version_with_gemset = @rvm_gemset ? "#{@rvm_ruby_version}
|
164
|
+
rvm_ruby_version_with_gemset = @rvm_gemset ? "#{@rvm_ruby_version}@#{@rvm_gemset}" : @rvm_ruby_version
|
140
165
|
"rvm #{rvm_ruby_version_with_gemset} ruby"
|
141
166
|
else
|
142
167
|
File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
|
data/lib/aruba/cucumber.rb
CHANGED
@@ -28,8 +28,13 @@ Given /^I am using rvm "([^\"]*)"$/ do |rvm_ruby_version|
|
|
28
28
|
use_rvm(rvm_ruby_version)
|
29
29
|
end
|
30
30
|
|
31
|
-
Given /^I am using rvm gemset "([^\"]*)"$/ do |rvm_gemset|
|
32
|
-
use_rvm_gemset(rvm_gemset)
|
31
|
+
Given /^I am using( an empty)? rvm gemset "([^\"]*)"$/ do |empty_gemset, rvm_gemset|
|
32
|
+
use_rvm_gemset(rvm_gemset, empty_gemset)
|
33
|
+
end
|
34
|
+
|
35
|
+
Given /^I am using rvm gemset "([^\"]*)" with Gemfile:$/ do |rvm_gemset, gemfile|
|
36
|
+
use_rvm_gemset(rvm_gemset, true)
|
37
|
+
install_gems(gemfile)
|
33
38
|
end
|
34
39
|
|
35
40
|
Given /^a directory named "([^\"]*)"$/ do |dir_name|
|
@@ -53,14 +58,11 @@ When /^I cd to "([^\"]*)"$/ do |dir|
|
|
53
58
|
end
|
54
59
|
|
55
60
|
When /^I run "(.*)"$/ do |cmd|
|
56
|
-
run(unescape(cmd))
|
61
|
+
run(unescape(cmd), false)
|
57
62
|
end
|
58
63
|
|
59
64
|
When /^I successfully run "(.*)"$/ do |cmd|
|
60
65
|
run(unescape(cmd))
|
61
|
-
if(@last_exit_status != 0)
|
62
|
-
fail("Exit status was #{@last_exit_status}. Output:\n#{combined_output}")
|
63
|
-
end
|
64
66
|
end
|
65
67
|
|
66
68
|
Then /^I should see "([^\"]*)"$/ do |partial_output|
|
@@ -91,7 +93,7 @@ end
|
|
91
93
|
# you don't need regex, use "I should see" instead since
|
92
94
|
# that way, you don't have to escape regex characters that
|
93
95
|
# appear naturally in the output
|
94
|
-
Then /^I should see matching
|
96
|
+
Then /^I should see matching \/([^\/]*)\/$/ do |partial_output|
|
95
97
|
combined_output.should =~ /#{partial_output}/
|
96
98
|
end
|
97
99
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 8
|
9
|
+
version: 0.1.8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Aslak Helles\xC3\xB8y"
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-04-28 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -41,9 +41,11 @@ dependencies:
|
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
segments:
|
43
43
|
- 0
|
44
|
+
- 7
|
45
|
+
- 0
|
46
|
+
- beta
|
44
47
|
- 6
|
45
|
-
|
46
|
-
version: 0.6.2
|
48
|
+
version: 0.7.0.beta.6
|
47
49
|
type: :development
|
48
50
|
version_requirements: *id002
|
49
51
|
description: CLI Steps for Cucumber, hand-crafted for you in Aruba
|