Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #29 from elliterate/fix_capistrano_defaults

Only set explicitly defined Capistrano variables.
  • Loading branch information...
commit bc68be3d3da2600ba5cc374771928480ded61978 2 parents d3495fa + ee0d174
@zilkey authored
View
4 lib/auto_tagger/capistrano_helper.rb
@@ -41,14 +41,14 @@ def auto_tagger_options
if ! variables[:auto_tagger_dry_run].nil?
options[:dry_run] = variables[:auto_tagger_dry_run]
else
- options[:dry_run] = variables[:dry_run]
+ options[:dry_run] = variables[:dry_run] if variables.has_key?(:dry_run)
end
[
:date_separator, :push_refs, :fetch_refs, :remote, :ref_path, :offline,
:verbose, :refs_to_keep, :executable, :opts_file
].each do |key|
- options[key] = variables[:"auto_tagger_#{key}"]
+ options[key] = variables[:"auto_tagger_#{key}"] if variables.has_key?(:"auto_tagger_#{key}")
end
options
View
8 spec/auto_tagger/capistrano_helper_spec.rb
@@ -82,8 +82,12 @@
:executable,
:opts_file
].each do |key|
- it "includes :#{key}" do
- helper = AutoTagger::CapistranoHelper.new :"auto_tagger_#{key}" => "value"
+ it "includes :#{key} when specified" do
+ helper = AutoTagger::CapistranoHelper.new({})
+ helper.auto_tagger_options.should_not have_key(key)
+
+ helper = AutoTagger::CapistranoHelper.new(:"auto_tagger_#{key}" => "value")
+ helper.auto_tagger_options.should have_key(key)
helper.auto_tagger_options[key].should == "value"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.