diff options
-rw-r--r-- | lib/bundler/dsl.rb | 4 | ||||
-rw-r--r-- | spec/install/gems/simple_case_spec.rb | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index 9be847d583..e2994e4b26 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -44,6 +44,10 @@ module Bundler end def gem(name, *args) + if name.is_a?(Symbol) + raise GemfileError, %{You need to specify gem names as Strings. Use 'gem "#{name.to_s}"' instead.} + end + options = Hash === args.last ? args.pop : {} version = args.last || ">= 0" if group = options[:groups] || options[:group] diff --git a/spec/install/gems/simple_case_spec.rb b/spec/install/gems/simple_case_spec.rb index 77444f2dad..b9dc7d05f7 100644 --- a/spec/install/gems/simple_case_spec.rb +++ b/spec/install/gems/simple_case_spec.rb @@ -21,6 +21,14 @@ describe "bundle install with gem sources" do should_be_installed("rack 1.0.0") end + it "raises an appropriate error when gems are specified using symbols" do + status = install_gemfile(<<-G, :exit_status => true) + source "file://#{gem_repo1}" + gem :rack + G + status.should == 4 + end + it "pulls in dependencies" do install_gemfile <<-G source "file://#{gem_repo1}" |