Skip to content

Commit

Permalink
add missing tests for postgresql_conf provider
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonHoenscheid committed Aug 28, 2023
1 parent 9f5fd14 commit 021f5a3
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions spec/unit/provider/postgresql_conf/ruby_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,54 @@
let(:resource) { Puppet::Type.type(:postgresql_conf).new(name: 'foo', value: 'bar') }
let(:provider) { resource.provider }

# rubocop:disable RSpec/ReceiveMessages
before(:each) do
allow(provider).to receive(:file_path).and_return('/tmp/foo')
allow(provider).to receive(:read_file).and_return('foo = bar')
allow(provider).to receive(:write_file).and_return(true)
end
# rubocop:enable RSpec/ReceiveMessages

it 'has a method parse_config' do
expect(provider).to respond_to(:parse_config)
end

it 'has a method delete_header' do
expect(provider).to respond_to(:delete_header)
end

it 'has a method add_header' do
expect(provider).to respond_to(:add_header)
end

it 'has a method exists?' do
expect(provider).to respond_to(:exists?)
end

it 'has a method create' do
expect(provider).to respond_to(:create)
end

it 'has a method destroy' do
expect(provider).to respond_to(:destroy)
end

it 'has a method value' do
expect(provider).to respond_to(:value)
end

it 'has a method value=' do
expect(provider).to respond_to(:value=)
end

it 'has a method comment' do
expect(provider).to respond_to(:comment)
end

it 'has a method comment=' do
expect(provider).to respond_to(:comment=)
end

it 'is an instance of the Provider Ruby' do
expect(provider).to be_an_instance_of Puppet::Type::Postgresql_conf::ProviderRuby
end
Expand Down

0 comments on commit 021f5a3

Please sign in to comment.