summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/puppet/provider/ini_setting/ruby_spec.rb44
1 files changed, 44 insertions, 0 deletions
diff --git a/spec/unit/puppet/provider/ini_setting/ruby_spec.rb b/spec/unit/puppet/provider/ini_setting/ruby_spec.rb
index 2dbbf55..ac9bb91 100644
--- a/spec/unit/puppet/provider/ini_setting/ruby_spec.rb
+++ b/spec/unit/puppet/provider/ini_setting/ruby_spec.rb
@@ -392,4 +392,48 @@ bar = baz
end
end
+ context "when overriding the separator" do
+ let(:orig_content) {
+ <<-EOS
+[section2]
+foo=bar
+ EOS
+ }
+
+ it "should modify an existing setting" do
+ resource = Puppet::Type::Ini_setting.new(common_params.merge(
+ :section => 'section2',
+ :setting => 'foo',
+ :value => 'yippee',
+ :key_val_separator => '='))
+ provider = described_class.new(resource)
+ provider.exists?.should == false
+ provider.create
+ validate_file(<<-EOS
+[section2]
+foo=yippee
+ EOS
+ )
+ end
+
+ it "should add a new setting" do
+ resource = Puppet::Type::Ini_setting.new(common_params.merge(
+ :section => 'section2',
+ :setting => 'bar',
+ :value => 'baz',
+ :key_val_separator => '='))
+ provider = described_class.new(resource)
+ provider.exists?.should == false
+ provider.create
+ validate_file(<<-EOS
+[section2]
+foo=bar
+bar=baz
+ EOS
+ )
+ end
+
+
+ end
+
end