summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-03-11 01:09:23 -0700
committerAndre Arko <andre@arko.net>2015-03-11 01:10:10 -0700
commit22590270f3af681838e7cbef699fa25f734126f4 (patch)
tree0a9cb17314a7f069c4d145a529ef910c0797d6a9
parentba333b21583109447503ee4ab68891c6438b7df3 (diff)
downloadbundler-22590270f3af681838e7cbef699fa25f734126f4.tar.gz
test each firstrun question
-rw-r--r--spec/commands/newgem_spec.rb41
1 files changed, 41 insertions, 0 deletions
diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb
index 2ca9a8a768..044d71dd80 100644
--- a/spec/commands/newgem_spec.rb
+++ b/spec/commands/newgem_spec.rb
@@ -1,6 +1,7 @@
require "spec_helper"
describe "bundle gem" do
+
def reset!
super
global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false"
@@ -584,4 +585,44 @@ describe "bundle gem" do
end
end
end
+
+ context "on first run" do
+ before do
+ in_app_root
+ end
+
+ it "asks about test framework" do
+ global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__COC" => "false"
+
+ bundle "gem foobar" do |input|
+ input.puts "rspec"
+ end
+
+ expect(bundled_app("foobar/spec/spec_helper.rb")).to exist
+ end
+
+ it "asks about MIT license" do
+ global_config "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false"
+
+ bundle :config
+
+ bundle "gem foobar" do |input|
+ input.puts "yes"
+ end
+
+ expect(bundled_app("foobar/LICENSE.txt")).to exist
+ end
+
+ it "asks about CoC" do
+ global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false"
+
+
+ bundle "gem foobar" do |input|
+ input.puts "yes"
+ end
+
+ expect(bundled_app("foobar/CODE_OF_CONDUCT.md")).to exist
+ end
+ end
+
end