Permalink
Browse files

Merge pull request #872 from guard/plugin-improved-type-checking

Improve Plugin type checking
  • Loading branch information...
rymai committed Jan 8, 2018
2 parents 3091066 + b8c8ca2 commit adcf25ec01f3e1885f650bed8bbdfbf88f37770a
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/guard/plugin_util.rb
  2. +1 −1 spec/lib/guard/plugin_util_spec.rb
View
@@ -55,7 +55,7 @@ def initialize(name)
def initialize_plugin(options)
klass = plugin_class
fail "Could not load class: #{_constant_name.inspect}" unless klass
if klass.superclass.to_s == "Guard::Guard"
if klass.ancestors.include?(Guard)
klass.new(options.delete(:watchers), options)
else
begin
@@ -71,7 +71,7 @@
context "with a plugin inheriting from Guard::Plugin" do
before do
expect(guard_rspec_class).to receive(:superclass) { ::Guard::Plugin }
expect(guard_rspec_class).to receive(:ancestors) { [::Guard::Plugin] }
end
it "instantiate the plugin using the new API" do

0 comments on commit adcf25e

Please sign in to comment.