module-postgresql/spec
Dominic Cleal b7cbe60d4b (MODULES-775) Fix refresh/unless parameter interactions
Interactions between resource refreshes and the 'unless' parameter have been
fixed to follow the behaviour of the 'exec' type.

The 'unless' parameter is now always taken into account, whether in ordinary
operation, during a refresh, or when refreshonly is set to true.  The resource
will not run the SQL command when the 'unless' clause matches a row.

Previously a refresh on a resource would ignore the 'unless' parameter if set
which could cause a failure re-running a command, such as attempting to create
a role that already exists.

The following examples have been fixed:

  * should not run SQL when refreshed and the unless query returns rows
  * with refreshonly should not run SQL when the unless query returns no rows
  * with refreshonly should not run SQL when refreshed and the unless query
    returns rows

This is done by moving the logic for refreshonly and whether to run the SQL
command from the provider into the type, and consolidating it in the
should_run_sql method which is called during 'command' property retrieval
(instead of sync) and during refresh.
2014-06-03 10:25:13 +01:00
..
acceptance (MODULES-775) Fix refresh/unless parameter interactions 2014-06-03 10:25:13 +01:00
unit (MODULES-775) Fix refresh/unless parameter interactions 2014-06-03 10:25:13 +01:00
spec_helper.rb Add strict_variables support in unit tests 2014-04-08 16:38:38 +02:00
spec_helper_acceptance.rb Merge branch '3.3.x' into merge33x 2014-05-13 21:08:41 +02:00