-
-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix matchers on 1.9.3 not picking up define_method.
I am not sure why define_method is not being found on 1.9.3. This was just me being a bit lazy and not wanting to copy and paste everything.
- Loading branch information
1 parent
36f0dc5
commit c37fe9d
Showing
1 changed file
with
26 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,31 @@ | ||
%w{start enable stop disable}.each do |action| | ||
define_method(:"#{action}_runit_service") do |name| | ||
ChefSpec::Matchers::ResourceMatcher.new(:runit_service, action.to_sym, name) | ||
end | ||
def start_runit_service(name) | ||
ChefSpec::Matchers::ResourceMatcher.new(:runit_service, :start, name) | ||
end | ||
|
||
%w{install uninstall}.each do |action| | ||
define_method(:"#{action}_golang_package") do |name| | ||
ChefSpec::Matchers::ResourceMatcher.new(:golang_package, action.to_sym, name) | ||
end | ||
def stop_runit_service(name) | ||
ChefSpec::Matchers::ResourceMatcher.new(:runit_service, :stop, name) | ||
end | ||
|
||
%w{put dump}.each do |action| | ||
define_method(:"#{action}_ark") do |name| | ||
ChefSpec::Matchers::ResourceMatcher.new(:ark, action.to_sym, name) | ||
end | ||
def enable_runit_service(name) | ||
ChefSpec::Matchers::ResourceMatcher.new(:runit_service, :enable, name) | ||
end | ||
|
||
def disable_runit_service(name) | ||
ChefSpec::Matchers::ResourceMatcher.new(:runit_service, :disable, name) | ||
end | ||
|
||
def install_golang_package(name) | ||
ChefSpec::Matchers::ResourceMatcher.new(:golang_package, :install, name) | ||
end | ||
|
||
def uninstall_golang_package(name) | ||
ChefSpec::Matchers::ResourceMatcher.new(:golang_package, :uninstall, name) | ||
end | ||
|
||
def put_ark(name) | ||
ChefSpec::Matchers::ResourceMatcher.new(:ark, :put, name) | ||
end | ||
|
||
def dump_ark(name) | ||
ChefSpec::Matchers::ResourceMatcher.new(:ark, :dump, name) | ||
end |