Skip to content

Commit

Permalink
stub Gem.default_dir and Gem.path to be identical to Gem.dir
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Dec 9, 2009
1 parent 146db30 commit 53f6e47
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/bundler/templates/environment.erb
Expand Up @@ -122,6 +122,7 @@ end
module Gem
def self.ruby ; <%= Gem.ruby.inspect %> ; end
def self.dir ; @dir ||= File.dirname(File.expand_path(__FILE__)) ; end
class << self ; alias default_dir dir; alias path dir ; end
class LoadError < ::LoadError; end
class Exception < RuntimeError; end
class CommandLineError < Exception; end
Expand Down
10 changes: 10 additions & 0 deletions spec/bundler/cli_spec.rb
Expand Up @@ -256,6 +256,16 @@
out = run_in_context "puts Gem.dir"
out.should == "#{bundled_app}/vendor/gems"
end

it "stubs out Gem.default_dir" do
out = run_in_context "puts Gem.default_dir"
out.should == "#{bundled_app}/vendor/gems"
end

it "stubs out Gem.path" do
out = run_in_context "puts Gem.path"
out.should == "#{bundled_app}/vendor/gems"
end
end

describe "relative paths everywhere" do
Expand Down

0 comments on commit 53f6e47

Please sign in to comment.