summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShim Won <marocchino@gmail.com>2015-03-23 08:58:42 +0900
committerShim Won <marocchino@gmail.com>2015-03-23 08:58:57 +0900
commitb99a3b76bb3b9001137e0f9eddb144c45f26c275 (patch)
treeec071e5d83cc21e15d647bd628720584f86236b0
parentda8ffe2a9a6a2142f55c1ddb8b31ca9ae50e8095 (diff)
downloadbundler-b99a3b76bb3b9001137e0f9eddb144c45f26c275.tar.gz
Apply test framework when install with asks
- resolve #3410
-rw-r--r--lib/bundler/cli/gem.rb1
-rw-r--r--spec/commands/newgem_spec.rb11
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb
index 9ce8de4a05..72cf62fc6c 100644
--- a/lib/bundler/cli/gem.rb
+++ b/lib/bundler/cli/gem.rb
@@ -74,6 +74,7 @@ module Bundler
end
if test_framework = ask_and_set_test_framework
+ config[:test] = test_framework
templates.merge!(".travis.yml.tt" => ".travis.yml")
case test_framework
diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb
index c8c5bf5917..f16671cbf1 100644
--- a/spec/commands/newgem_spec.rb
+++ b/spec/commands/newgem_spec.rb
@@ -591,6 +591,17 @@ describe "bundle gem" do
end
expect(bundled_app("foobar/spec/spec_helper.rb")).to exist
+ rakefile = strip_whitespace <<-RAKEFILE
+ require "bundler/gem_tasks"
+ require "rspec/core/rake_task"
+
+ RSpec::Core::RakeTask.new(:spec)
+
+ task :default => :spec
+ RAKEFILE
+
+ expect(bundled_app("foobar/Rakefile").read).to eq(rakefile)
+ expect(bundled_app("foobar/foobar.gemspec").read).to include('spec.add_development_dependency "rspec"')
end
it "asks about MIT license" do