Skip to content

Commit

Permalink
Fix matchers on 1.9.3 not picking up define_method.
Browse files Browse the repository at this point in the history
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
johnbellone committed Sep 3, 2014
1 parent 36f0dc5 commit c37fe9d
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions spec/support/matchers.rb
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

0 comments on commit c37fe9d

Please sign in to comment.