Skip to content

RSpec renamed be_true to be_truthy in 3.0 #524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions spec/unit/puppet/provider/database_user/mysql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
subject.expects(:mysql).with([defaults_file, 'mysql', '-e', "grant usage on *.* to 'joe'@'localhost' identified by PASSWORD
'*6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4' with max_user_connections 10"])
@provider.expects(:exists?).returns(true)
@provider.create.should be_true
@provider.create.should be_truthy
end
end

describe 'destroy' do
it 'removes a user if present' do
subject.expects(:mysql).with([defaults_file, 'mysql', '-e', "drop user 'joe'@'localhost'"])
@provider.expects(:exists?).returns(false)
@provider.destroy.should be_true
@provider.destroy.should be_truthy
end
end

Expand Down Expand Up @@ -98,7 +98,7 @@
describe 'exists?' do
it 'checks if user exists' do
subject.expects(:mysql).with([defaults_file, 'mysql', '-NBe', "select '1' from mysql.user where CONCAT(user, '@', host) = 'joe@localhost'"]).returns('1')
@provider.exists?.should be_true
@provider.exists?.should be_truthy
end
end

Expand Down
6 changes: 3 additions & 3 deletions spec/unit/puppet/provider/mysql_database/mysql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@
it 'makes a database' do
provider.expects(:mysql).with([defaults_file, '-NBe', "create database if not exists `#{resource[:name]}` character set #{resource[:charset]} collate #{resource[:collate]}"])
provider.expects(:exists?).returns(true)
provider.create.should be_true
provider.create.should be_truthy
end
end

describe 'destroy' do
it 'removes a database if present' do
provider.expects(:mysql).with([defaults_file, '-NBe', "drop database `#{resource[:name]}`"])
provider.expects(:exists?).returns(false)
provider.destroy.should be_true
provider.destroy.should be_truthy
end
end

describe 'exists?' do
it 'checks if database exists' do
instance.exists?.should be_true
instance.exists?.should be_truthy
end
end

Expand Down
6 changes: 3 additions & 3 deletions spec/unit/puppet/provider/mysql_user/mysql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,21 @@
it 'makes a user' do
provider.expects(:mysql).with([defaults_file, '-e', "GRANT USAGE ON *.* TO 'joe'@'localhost' IDENTIFIED BY PASSWORD '*6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4' WITH MAX_USER_CONNECTIONS 10 MAX_CONNECTIONS_PER_HOUR 10 MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 10"])
provider.expects(:exists?).returns(true)
provider.create.should be_true
provider.create.should be_truthy
end
end

describe 'destroy' do
it 'removes a user if present' do
provider.expects(:mysql).with([defaults_file, '-e', "DROP USER 'joe'@'localhost'"])
provider.expects(:exists?).returns(false)
provider.destroy.should be_true
provider.destroy.should be_truthy
end
end

describe 'exists?' do
it 'checks if user exists' do
instance.exists?.should be_true
instance.exists?.should be_truthy
end
end

Expand Down