summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2009-12-18 10:50:24 -0800
committerCarlhuda <carlhuda@engineyard.com>2009-12-18 10:50:24 -0800
commit6c43f4c0568973bf18de3861a71b4ffd90b7d15e (patch)
tree798614942b723ff463706b9f66542551f0c8dfe9 /spec
parent5ef44d833b673d53d84d4f32387f341a2335942c (diff)
downloadbundler-6c43f4c0568973bf18de3861a71b4ffd90b7d15e.tar.gz
Fix the tests on 1.9
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/cli_spec.rb8
-rw-r--r--spec/bundler/manifest_spec.rb22
-rw-r--r--spec/support/builders.rb4
-rw-r--r--spec/support/helpers.rb1
4 files changed, 19 insertions, 16 deletions
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb
index 5ea09b92b0..159485c93e 100644
--- a/spec/bundler/cli_spec.rb
+++ b/spec/bundler/cli_spec.rb
@@ -34,7 +34,7 @@ describe "Bundler::CLI" do
@output.should_not =~ /Failed to build gem native extension/
out = run_in_context <<-RUBY
- require 'very_simple_binary'
+ require 'very_simple_binary_c'
puts VerySimpleBinaryInC
RUBY
@@ -48,7 +48,7 @@ describe "Bundler::CLI" do
gem_command :bundle, "--build-options=build.yml 2>&1"
out = run_in_context <<-RUBY
- require "very_simple_binary"
+ require "very_simple_binary_c"
puts VerySimpleBinaryInC
RUBY
out.should == "VerySimpleBinaryInC"
@@ -373,7 +373,7 @@ describe "Bundler::CLI" do
clear_sources
source "file://#{gem_repo1}"
gem "activesupport"
- gem "rake", :only => :server
+ gem "very-simple", :only => :server
gem "rack", :only => :test
Gemfile
end
@@ -386,7 +386,7 @@ describe "Bundler::CLI" do
out.should == "2.3.2"
out = run_in_context <<-RUBY
- begin ;require 'rake'
+ begin ;require 'very-simple'
rescue LoadError ; puts 'awesome' ; end
RUBY
out.should == 'awesome'
diff --git a/spec/bundler/manifest_spec.rb b/spec/bundler/manifest_spec.rb
index 2cb1052592..2129528fd2 100644
--- a/spec/bundler/manifest_spec.rb
+++ b/spec/bundler/manifest_spec.rb
@@ -115,16 +115,18 @@ describe "Bundler::Environment" do
end
it "it does not work with system gems if system gems have been disabled" do
- m = build_manifest <<-Gemfile
- clear_sources
- source "file://#{gem_repo1}"
- gem "rack"
- disable_system_gems
- Gemfile
-
- m.install
- out = run_in_context "begin ; require 'spec' ; rescue LoadError ; puts('WIN') ; end"
- out.should == "WIN"
+ system_gems 'rspec-1.2.7' do
+ m = build_manifest <<-Gemfile
+ clear_sources
+ source "file://#{gem_repo1}"
+ gem "rack"
+ disable_system_gems
+ Gemfile
+
+ m.install
+ out = run_in_context "begin ; require 'spec' ; rescue LoadError ; puts('WIN') ; end"
+ out.should == "WIN"
+ end
end
["Running with system gems", "Running without system gems"].each_with_index do |desc, i|
diff --git a/spec/support/builders.rb b/spec/support/builders.rb
index 94c43a1ce2..9f98c4d253 100644
--- a/spec/support/builders.rb
+++ b/spec/support/builders.rb
@@ -69,14 +69,14 @@ module Spec
exit 1 unless with_config("simple")
- extension_name = "very_simple_binary"
+ extension_name = "very_simple_binary_c"
dir_config extension_name
create_makefile extension_name
RUBY
s.write "ext/very_simple_binary.c", <<-C
#include "ruby.h"
- void Init_very_simple_binary() {
+ void Init_very_simple_binary_c() {
rb_define_module("VerySimpleBinaryInC");
}
C
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 939f60b4db..494cd07c5c 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -8,6 +8,7 @@ module Spec
def ruby(opts, ruby = nil)
ruby, opts = opts, nil unless ruby
ruby.gsub!(/(?=")/, "\\")
+ ruby.gsub!('$', '\\$')
lib = File.join(File.dirname(__FILE__), '..', '..', 'lib')
%x{#{Gem.ruby} -I#{lib} #{opts} -e "#{ruby}"}.strip
end