Skip to content
Snippets Groups Projects
Unverified Commit adcf25ec authored by Rémy Coutable's avatar Rémy Coutable Committed by GitHub
Browse files

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

Improve Plugin type checking
parents 30910669 b8c8ca2e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -55,7 +55,7 @@ module Guard
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
Loading
Loading
Loading
Loading
@@ -71,7 +71,7 @@ RSpec.describe Guard::PluginUtil do
 
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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment