-
Notifications
You must be signed in to change notification settings - Fork 791
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #376 from w32-blaster/master
Type mysql_grant fixed, spec test created
- Loading branch information
Showing
6 changed files
with
67 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
require 'puppet' | ||
require 'puppet/type/mysql_grant' | ||
describe Puppet::Type.type(:mysql_grant) do | ||
|
||
before :each do | ||
@user = Puppet::Type.type(:mysql_grant).new(:name => 'foo@localhost/*.*', :privileges => ['ALL', 'PROXY'], :table => ['*.*','@'], :user => 'foo@localhost') | ||
end | ||
|
||
it 'should accept a grant name' do | ||
@user[:name].should == 'foo@localhost/*.*' | ||
end | ||
|
||
it 'should accept ALL privileges' do | ||
@user[:privileges] = 'ALL' | ||
@user[:privileges].should == ['ALL'] | ||
end | ||
|
||
it 'should accept PROXY privilege' do | ||
@user[:privileges] = 'PROXY' | ||
@user[:privileges].should == ['PROXY'] | ||
end | ||
|
||
it 'should accept a table' do | ||
@user[:table] = '*.*' | ||
@user[:table].should == '*.*' | ||
end | ||
|
||
it 'should accept @ for table' do | ||
@user[:table] = '@' | ||
@user[:table].should == '@' | ||
end | ||
|
||
it 'should accept a user' do | ||
@user[:user] = 'foo@localhost' | ||
@user[:user].should == 'foo@localhost' | ||
end | ||
|
||
it 'should require a name' do | ||
expect { | ||
Puppet::Type.type(:mysql_grant).new({}) | ||
}.to raise_error(Puppet::Error, 'Title or name must be provided') | ||
end | ||
|
||
end |