Skip to content

Commit

Permalink
new spec for check_disk_is_mount_point
Browse files Browse the repository at this point in the history
  • Loading branch information
ailisp committed Oct 6, 2017
1 parent fc8f3dc commit 99937e2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/appliance_console/internal_database_configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,25 @@
@config.choose_disk
end

context "#check_disk_is_mount_point" do
it "not raise error if disk is given" do
expect(@config).to receive(:disk).and_return("/x")
@config.check_disk_is_mount_point
end

it "not raise error if no disk given but mount point for database is really a mount point" do
expect(@config).to receive(:disk).and_return(nil)
expect(@config).to receive(:pg_mount_point?).and_return(true)
@config.check_disk_is_mount_point
end

it "raise error if no disk given and not a mount point" do
expect(@config).to receive(:disk).and_return(nil)
expect(@config).to receive(:pg_mount_point?).and_return(false)
expect { @config.check_disk_is_mount_point }.to raise_error(RuntimeError, "The disk for database must be a mount point")
end
end

it ".postgresql_template" do
allow(PostgresAdmin).to receive_messages(:data_directory => Pathname.new("/var/lib/pgsql/data"))
allow(PostgresAdmin).to receive_messages(:template_directory => Pathname.new("/opt/manageiq/manageiq-appliance/TEMPLATE"))
Expand Down

0 comments on commit 99937e2

Please sign in to comment.