Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Release 0.2.2

  • Loading branch information...
commit 92c53d1fd8eaf18d834393503cced6b3cea0fc8c 1 parent 618e71f
@aslakhellesoy aslakhellesoy authored
View
2  History.txt
@@ -1,7 +1,7 @@
== 0.2.2
=== New Features
-* aruba/rails3 - steps for setting up a Rails3 project. Useful for testing Rails plugins. (Mark Nijhof, Aslak Hellesøy)
+* Added a @bin tag that sets up './bin' first on the path (Aslak Hellesøy)
* Richer API making aruba easier to use from Ruby code. (Mark Nijhof, Aslak Hellesøy)
=== Removed Features
View
8 lib/aruba/api.rb
@@ -65,6 +65,12 @@ def check_file_content(file, partial_content, expect_match)
end
end
+ def check_exact_file_content(file, exact_content)
+ in_current_dir do
+ IO.read(file).should == exact_content
+ end
+ end
+
def check_directory_presence(paths, expect_presence)
in_current_dir do
paths.each do |path|
@@ -189,7 +195,7 @@ def use_clean_gemset(gemset)
end
end
- def unset_ruby_env_vars
+ def unset_bundler_env_vars
%w[RUBYOPT BUNDLE_PATH BUNDLE_BIN_PATH BUNDLE_GEMFILE].each do |key|
set_env(key, nil)
end
View
18 lib/aruba/cucumber.rb
@@ -2,8 +2,20 @@
World(Aruba::Api)
+Before('@disable-bundler') do
+ unset_bundler_env_vars
+end
+
+Before('@bin') do
+ @__aruba_original_paths = (ENV['PATH'] || '').split(File::PATH_SEPARATOR)
+ ENV['PATH'] = ([File.expand_path('bin')] + @__aruba_original_paths).join(File::PATH_SEPARATOR)
+end
+
+After('@bin') do
+ ENV['PATH'] = @__aruba_original_paths.join(File::PATH_SEPARATOR)
+end
+
Before do
- unset_ruby_env_vars
FileUtils.rm_rf(current_dir)
end
@@ -170,3 +182,7 @@
Then /^the file "([^"]*)" should not contain "([^"]*)"$/ do |file, partial_content|
check_file_content(file, partial_content, false)
end
+
+Then /^the file "([^"]*)" should contain exactly:$/ do |file, exact_content|
+ check_exact_file_content(file, exact_content)
+end
View
13 lib/aruba/rails2.rb
@@ -1,13 +0,0 @@
-Given /^a Rails "(2[^"]*)" project named "([^"]*)" with Cucumber\-Rails generated with "([^"]*)"$/ do |rails_version, project_name, options|
- create_file("Gemfile", "source 'http://rubygems.org'\ngem 'rails', '#{rails_version}'")
- run("bundle install", true)
- run("which rails", true)
- # run("rails #{project_name}", true)
- # assert_passing_with("README")
- # cd(project_name)
- #
- # cucumber_rails = %{gem "cucumber-rails", :path => '../../..', :group => :test\n}
- # append_to_file("Gemfile", cucumber_rails)
- #
- # run("rails generate cucumber:install #{options}", true)
-end
View
13 lib/aruba/rails3.rb
@@ -1,13 +0,0 @@
-Given /^a Rails "(3[^"]*)" project named "([^"]*)" with Cucumber\-Rails generated with "([^"]*)"$/ do |rails_version, project_name, options|
- create_file("Gemfile", "source 'http://rubygems.org'\ngem 'rails', '#{rails_version}'")
- run("bundle install", true)
- run("rails new #{project_name}", true)
- assert_passing_with("README")
- cd(project_name)
-
- cucumber_rails = %{gem "cucumber-rails", :path => '../../..', :group => :test\n}
- append_to_file("Gemfile", cucumber_rails)
- run("bundle install", true)
- run("which rails")
- run("rails generate cucumber:install #{options}", true)
-end
Please sign in to comment.
Something went wrong with that request. Please try again.