spec/capistrano/env/config_spec.rb in capistrano-env-0.0.7 vs spec/capistrano/env/config_spec.rb in capistrano-env-0.1.0
- old
+ new
@@ -48,7 +48,16 @@
config.add /^CAPENV_TEST_/
config.add "CAPENV_TEST_B", "UNKO"
end
it { expect(config.envs).to eq({"CAPENV_TEST_A" => "a", "CAPENV_TEST_B" => "UNKO"}) }
end
+ describe "fix key with block" do
+ before do
+ config.add /^CAPENV_TEST_/
+ config.add /^CAPENV_TEST_/ do |key|
+ key.gsub(/CAPENV_/, '')
+ end
+ end
+ it { expect(config.envs).to eq({"CAPENV_TEST_A" => "a", "CAPENV_TEST_B" => "1,2,3", "TEST_A" => "a", "TEST_B" => "1,2,3"}) }
+ end
end
end