Skip to content

Commit

Permalink
Merge pull request #4183 from skateman/decorator-inheritance-spec
Browse files Browse the repository at this point in the history
Add spec to fail on indirect inheritance of MiqDecorator
  • Loading branch information
himdel authored Jun 25, 2018
2 parents ec3571a + bcd6577 commit 5482513
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/decorators/miq_decorator_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
describe MiqDecorator do
described_class.descendants.each do |klass|
next if klass == described_class # Skipping MiqDecorator

# This spec is intended to test the decorators defined in the ui-classic repo
# Any other decorator coming from e.g. the providers is allowed to inherit indirectly
next unless File.exist?(ManageIQ::UI::Classic.root.join('app', 'decorators', "#{klass.to_s.underscore}.rb"))

context "subclass #{klass}" do
it "is directly inherited from #{described_class}" do
expect(klass.superclass).to be(described_class)
end
end
end
end

0 comments on commit 5482513

Please sign in to comment.