spec/figaro/tasks_spec.rb in figaro-0.5.2 vs spec/figaro/tasks_spec.rb in figaro-0.5.3

- old
+ new

@@ -3,44 +3,44 @@ describe Figaro::Tasks do describe ".heroku" do it "configures Heroku" do Figaro.stub(:vars => "FOO=bar") - Open3.should_receive(:capture2).once.with("heroku config:get RAILS_ENV"). - and_return("development") - Open3.should_receive(:capture2).once.with("heroku config:add FOO=bar") + Figaro::Tasks.should_receive(:`).once.with("heroku config:get RAILS_ENV"). + and_return("development\n") + Figaro::Tasks.should_receive(:`).once.with("heroku config:add FOO=bar") Figaro::Tasks.heroku end it "configures a specific Heroku app" do Figaro.stub(:vars => "FOO=bar") - Open3.should_receive(:capture2).once. + Figaro::Tasks.should_receive(:`).once. with("heroku config:get RAILS_ENV --app my-app"). - and_return("development") - Open3.should_receive(:capture2).once. + and_return("development\n") + Figaro::Tasks.should_receive(:`).once. with("heroku config:add FOO=bar --app my-app") Figaro::Tasks.heroku("my-app") end it "respects the Heroku's remote Rails environment" do - Open3.stub(:capture2).with("heroku config:get RAILS_ENV"). - and_return("production") + Figaro::Tasks.stub(:`).with("heroku config:get RAILS_ENV"). + and_return("production\n") Figaro.should_receive(:vars).once.with("production").and_return("FOO=bar") - Open3.should_receive(:capture2).once.with("heroku config:add FOO=bar") + Figaro::Tasks.should_receive(:`).once.with("heroku config:add FOO=bar") Figaro::Tasks.heroku end it "defaults to the local Rails environment if not set remotely" do - Open3.stub(:capture2).with("heroku config:get RAILS_ENV"). + Figaro::Tasks.stub(:`).with("heroku config:get RAILS_ENV"). and_return("\n") Figaro.should_receive(:vars).once.with(nil).and_return("FOO=bar") - Open3.should_receive(:capture2).once.with("heroku config:add FOO=bar") + Figaro::Tasks.should_receive(:`).once.with("heroku config:add FOO=bar") Figaro::Tasks.heroku end describe "figaro:heroku", :rake => true do