spec/shelly/cli/main_spec.rb in shelly-0.2.20 vs spec/shelly/cli/main_spec.rb in shelly-0.2.21
- old
+ new
@@ -1555,11 +1555,11 @@
end
context "when neither thin nor puma present in Gemfile" do
it "should show that necessary gem doesn't exist" do
Bundler::Definition.stub_chain(:build, :specs, :map).and_return([])
- $stdout.should_receive(:puts).with(" #{red("✗")} Missing web server gem in Gemfile. Currently supported: 'thin' and 'puma'")
+ $stdout.should_receive(:puts).with(" #{yellow("ϟ")} Missing web server gem in Gemfile. Currently supported: 'thin' and 'puma'")
invoke(@main, :check)
end
end
end
@@ -1610,11 +1610,11 @@
context "cloudfile" do
before do
cloud = mock(:code_name => "foo-staging", :cloud_databases => ["postgresql"],
:whenever? => true, :delayed_job? => true, :sidekiq? => true,
- :to_s => "foo-staging")
+ :thin? => true, :puma? => true, :to_s => "foo-staging")
cloudfile = mock(:clouds => [cloud])
Shelly::Cloudfile.stub(:new).and_return(cloudfile)
end
@@ -1671,9 +1671,37 @@
end
it "should show that necessary gem exists - pg" do
Bundler::Definition.stub_chain(:build, :specs, :map).and_return(["pg"])
$stdout.should_receive(:puts).with(" #{green("✓")} Postgresql driver is present for 'foo-staging' cloud")
+ invoke(@main, :check)
+ end
+ end
+
+ context "thin web server" do
+ it "should show that necessary gem doesn't exist" do
+ Bundler::Definition.stub_chain(:build, :specs, :map).and_return([])
+ $stdout.should_receive(:puts).with(" #{red("✗")} Gem 'thin' is missing in the Gemfile for 'foo-staging' cloud")
+ invoke(@main, :check)
+ end
+
+ it "should show that necessary gem exists" do
+ Bundler::Definition.stub_chain(:build, :specs, :map).and_return(["thin"])
+ $stdout.should_receive(:puts).with(" #{green("✓")} Web server gem 'thin' is present")
+ invoke(@main, :check)
+ end
+ end
+
+ context "puma web server" do
+ it "should show that necessary gem doesn't exist" do
+ Bundler::Definition.stub_chain(:build, :specs, :map).and_return([])
+ $stdout.should_receive(:puts).with(" #{red("✗")} Gem 'puma' is missing in the Gemfile for 'foo-staging' cloud")
+ invoke(@main, :check)
+ end
+
+ it "should show that necessary gem exists" do
+ Bundler::Definition.stub_chain(:build, :specs, :map).and_return(["puma"])
+ $stdout.should_receive(:puts).with(" #{green("✓")} Web server gem 'puma' is present")
invoke(@main, :check)
end
end
end