-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:dylanratcliffe/onceover
- Loading branch information
Showing
18 changed files
with
139 additions
and
92 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
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 was deleted.
Oops, something went wrong.
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
32 changes: 0 additions & 32 deletions
32
spec/fixtures/controlrepos/function_mocking/manifests/site.pp
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
spec/fixtures/controlrepos/function_mocking/site/profile/functions/fail_puppet.pp
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,5 @@ | ||
function profile::fail_puppet ( | ||
String $message, | ||
) { | ||
fail($message) | ||
} |
9 changes: 9 additions & 0 deletions
9
...ures/controlrepos/function_mocking/site/profile/lib/puppet/functions/profile/fail_ruby.rb
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,9 @@ | ||
Puppet::Functions.create_function(:'profile::fail_ruby') do | ||
dispatch :fail do | ||
param 'String', :message | ||
end | ||
|
||
def fail(message) | ||
call_function('fail', message) | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
spec/fixtures/controlrepos/function_mocking/site/profile/manifests/base.pp
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,10 @@ | ||
# Class: profile::base | ||
# | ||
# | ||
class profile::base { | ||
# This function should fail unless it is mocked | ||
profile::fail_puppet('Puppet language function still failed!') | ||
|
||
# So should this | ||
profile::fail_ruby('Ruby function failed!') | ||
} |
12 changes: 6 additions & 6 deletions
12
...ing/site/role/manifests/test_functions.pp → ...g/site/role/manifests/test_data_return.pp
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
# == Class: role::test_functions | ||
# | ||
class role::test_functions { | ||
unless string('foo') =~ String { | ||
class role::test_data_return { | ||
unless return_string() =~ String { | ||
fail('string() did not return a string') | ||
} | ||
unless number('foo') =~ Numeric { | ||
unless return_number('foo','bar') =~ Numeric { | ||
fail('string() did not return a string') | ||
} | ||
unless boolean('foo') =~ Boolean { | ||
unless return_boolean('foo') =~ Boolean { | ||
fail('string() did not return a string') | ||
} | ||
unless array('foo') =~ Array { | ||
unless return_array('foo') =~ Array { | ||
fail('string() did not return a string') | ||
} | ||
unless hash('foo') =~ Hash { | ||
unless return_hash('foo') =~ Hash { | ||
fail('string() did not return a string') | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
spec/fixtures/controlrepos/function_mocking/site/role/manifests/test_new_functions.pp
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,12 @@ | ||
# Class: role::test_new_functions | ||
# | ||
# | ||
class role::test_new_functions { | ||
|
||
# This function should fail unless it is mocked | ||
profile::fail_puppet('Puppet language function still failed!') | ||
|
||
# So should this | ||
profile::fail_ruby('Ruby function failed!') | ||
|
||
} |
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