Skip to content

Instantly share code, notes, and snippets.

@mycargus
Created October 25, 2015 21:54
Show Gist options
  • Select an option

  • Save mycargus/e79ad72a29b9b2811ff2 to your computer and use it in GitHub Desktop.

Select an option

Save mycargus/e79ad72a29b9b2811ff2 to your computer and use it in GitHub Desktop.
describe FunctionalInterface do
before :all do
@implementations =
ObjectSpace.each_object(Class)
.select { |klass| klass < FunctionalInterface }
end
it "should enforce that the interface is implemented" do
@implementations.each do |klass|
entity = klass.new
expect { entity.do_thing }.to not_raise
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment