Skip to content

Instantly share code, notes, and snippets.

@pdabrowski6
Last active January 12, 2018 15:56
Show Gist options
  • Save pdabrowski6/d2b987a8e27e320cf7191fd719840841 to your computer and use it in GitHub Desktop.
Save pdabrowski6/d2b987a8e27e320cf7191fd719840841 to your computer and use it in GitHub Desktop.
class Describe
attr_reader :context_name, :examples
def initialize(context_name, &block)
@context_name = context_name
@describes = []
@examples = []
instance_eval &block
end
def describe(context_name, &block)
describes << Describe.new(context_name, &block)
end
def it(context_name, &block)
examples << Example.new(context_name, &block)
end
private
attr_accessor :describes
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment