This conversion is done by Transpec 2.3.1 with the following command:
transpec -f -c "bundle exec rake spec"
* 82 conversions
from: it { should ... }
to: it { is_expected.to ... }
* 21 conversions
from: == expected
to: eq(expected)
* 20 conversions
from: obj.should
to: expect(obj).to
* 5 conversions
from: its([:key]) { }
to: describe '[:key]' do subject { super()[:key] }; it { } end
* 1 conversion
from: it { should_not ... }
to: it { is_expected.not_to ... }
* 1 conversion
from: its(:attr) { }
to: describe '#attr' do subject { super().attr }; it { } end
For more details: https://github.com/yujinakayama/transpec#supported-conversions
This doesn't fix the root cause of the issue, such as the fact that
dpkg can't do wildcard removals, and the uninstall fails when you're
passing in a version number like this, but THIS test doesn't care, it
just wants to make sure the deprecation warning appears in the first
place.
This does however make the tests pass on 14.04.
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.
The validate_db_connection class takes a user to connect as, but if we're
using the progresql::server::db defined type then the user might not be
created yet, and might not have any permissions granted yet. This patch
users a collector to ensure that the that the user and grants are active
before validating.
We now test if service_ensure is 'running' or 'stopped' but it was
actually picking up the default value of ensure in params.pp which
was true, not present.
Fix this and thereby fix the failing test.