resource = Puppet::Type::Ini_setting.new(common_params.merge(
:setting => 'yahoo', :value => 'yippee'))
provider = described_class.new(resource)
- provider.exists?.should == false
+ provider.exists?.should be_nil
provider.create
validate_file(<<-EOS
# This is a comment
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:section => 'section:sub', :setting => 'yahoo', :value => 'yippee'))
provider = described_class.new(resource)
- provider.exists?.should == false
+ provider.exists?.should be_nil
provider.create
validate_file(<<-EOS
# This is a comment
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:setting => 'baz', :value => 'bazvalue2'))
provider = described_class.new(resource)
- provider.exists?.should == false
- provider.create
+ provider.exists?.should == 'bazvalue'
+ provider.value=('bazvalue2')
validate_file(<<-EOS
# This is a comment
[section1]
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:section => 'section:sub', :setting => 'subby', :value => 'foo'))
provider = described_class.new(resource)
- provider.exists?.should == false
- provider.create
+ provider.exists?.should == 'bar'
+ provider.value.should == 'bar'
+ provider.value=('foo')
validate_file(<<-EOS
# This is a comment
[section1]
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:setting => 'url', :value => 'http://192.168.0.1:8080'))
provider = described_class.new(resource)
- provider.exists?.should == false
- provider.create
+ provider.exists?.should == 'http://192.168.1.1:8080'
+ provider.value.should == 'http://192.168.1.1:8080'
+ provider.value=('http://192.168.0.1:8080')
validate_file( <<-EOS
# This is a comment
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:setting => 'baz', :value => 'bazvalue'))
provider = described_class.new(resource)
- provider.exists?.should == true
+ provider.exists?.should == 'bazvalue'
end
it "should add a new section if the section does not exist" do
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:section => "section3", :setting => 'huzzah', :value => 'shazaam'))
provider = described_class.new(resource)
- provider.exists?.should == false
+ provider.exists?.should be_nil
provider.create
validate_file(<<-EOS
# This is a comment
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:section => "section:subsection", :setting => 'huzzah', :value => 'shazaam'))
provider = described_class.new(resource)
- provider.exists?.should == false
+ provider.exists?.should be_nil
provider.create
validate_file(<<-EOS
# This is a comment
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:section => "section1", :setting => 'setting1', :value => 'hellowworld', :path => emptyfile))
provider = described_class.new(resource)
- provider.exists?.should == false
+ provider.exists?.should be_nil
provider.create
validate_file("
[section1]
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:section => "section:subsection", :setting => 'setting1', :value => 'hellowworld', :path => emptyfile))
provider = described_class.new(resource)
- provider.exists?.should == false
+ provider.exists?.should be_nil
provider.create
validate_file("
[section:subsection]
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:section => "section1", :setting => 'master', :value => true))
provider = described_class.new(resource)
- provider.exists?.should == true
- provider.create
+ provider.exists?.should == 'true'
+ provider.value.should == 'true'
end
end
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:section => '', :setting => 'bar', :value => 'yippee'))
provider = described_class.new(resource)
- provider.exists?.should == false
+ provider.exists?.should be_nil
provider.create
validate_file(<<-EOS
# This is a comment
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:section => '', :setting => 'foo', :value => 'yippee'))
provider = described_class.new(resource)
- provider.exists?.should == false
- provider.create
+ provider.exists?.should == 'blah'
+ provider.value.should == 'blah'
+ provider.value=('yippee')
validate_file(<<-EOS
# This is a comment
foo = yippee
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:section => '', :setting => 'foo', :value => 'blah'))
provider = described_class.new(resource)
- provider.exists?.should == true
+ provider.exists?.should == 'blah'
end
end
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:section => '', :setting => 'foo', :value => 'yippee'))
provider = described_class.new(resource)
- provider.exists?.should == false
+ provider.exists?.should be_nil
provider.create
validate_file(<<-EOS
foo = yippee
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:section => 'section2', :setting => 'foo', :value => 'yippee'))
provider = described_class.new(resource)
- provider.exists?.should == false
- provider.create
+ provider.exists?.should == 'http://192.168.1.1:8080'
+ provider.value.should == 'http://192.168.1.1:8080'
+ provider.value=('yippee')
validate_file(<<-EOS
[section2]
foo = yippee
resource = Puppet::Type::Ini_setting.new(common_params.merge(
:section => 'section2', :setting => 'bar', :value => 'baz'))
provider = described_class.new(resource)
- provider.exists?.should == false
+ provider.exists?.should be_nil
provider.create
validate_file(<<-EOS
[section2]
:value => 'yippee',
:key_val_separator => '='))
provider = described_class.new(resource)
- provider.exists?.should == false
- provider.create
+ provider.exists?.should == 'bar'
+ provider.value.should == 'bar'
+ provider.value=('yippee')
validate_file(<<-EOS
[section2]
foo=yippee
:value => 'baz',
:key_val_separator => '='))
provider = described_class.new(resource)
- provider.exists?.should == false
+ provider.exists?.should be_nil
provider.create
validate_file(<<-EOS
[section2]