Sha256: 6aa66590c9cfb9ae7bc4a28c9d8072eb50e9c4b8a302d43432bbca0ab1e0b63d
Contents?: true
Size: 1.27 KB
Versions: 16
Compression:
Stored size: 1.27 KB
Contents
require "spec_helper" describe "env cli" do describe "bulk cmd" do before(:each) do FakeFS::FileSystem.clear FakeFS.activate! File.open(".rbenv-vars.example", "w") do |file| file.puts "#COMMENTED=HI" file.puts "SERVER=platan.us" file.puts "PASSWORD=oops" end end after(:each) do FakeFS.deactivate! end it "asks for stage if not selected" do expect(Negroku::Modes::Env).to receive(:select_stage) Negroku::Modes::Env.bulk end it "use selected stage if passed" do allow(Negroku::Modes::Env).to receive(:select_variables).and_return([]) expect(Negroku::Modes::Env).not_to receive(:select_stage) Negroku::Modes::Env.bulk "beta" end it "selects the stage and calls rbenv:vars:set with the vars" do allow(Negroku::Modes::Env).to receive(:select_variables).and_return({USER: "emilio", PASSWORD: "123"}) expect(Capistrano::Application).to receive(:invoke).with("beta") expect(Capistrano::Application).to receive(:invoke).with("rbenv:vars:set", "USER=emilio", "PASSWORD=123") Negroku::Modes::Env.bulk "beta" end it "returns the list of variables" do expect{|b| Negroku::Modes::Env.get_variables(&b)}.to yield_control.twice end end end
Version data entries
16 entries across 16 versions & 1 rubygems