Skip to content

Instantly share code, notes, and snippets.

@isaacsanders
Created January 4, 2012 17:21
Show Gist options
  • Select an option

  • Save isaacsanders/1561068 to your computer and use it in GitHub Desktop.

Select an option

Save isaacsanders/1561068 to your computer and use it in GitHub Desktop.
Shared Examples
module CoolMixin
# Cool functionality
end
class Base
end
class CoolCat < Base
include CoolMixin
end
class CoolCats < Base
extend CoolMixin
end
shared_examples_for "cool things" do
# This is where you are testing the CoolMixin
end
describe CoolCat do
it_should_behave_like "cools things"
end
describe CoolCats do
subject { CoolCats }
it_should_behave_like "cool things"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment