module Protest::Stories::TestCase

Public Class Methods

included(base) click to toggle source
# File lib/protest/stories.rb, line 27
def self.included(base)
  class << base
    def story(description, &block)
      context(description) do
        Protest::Stories.all[self] = Protest::Stories::Story.new(description)
        class_eval(&block) if block_given?
      end
    end

    def scenario(name, &block)
      scenario = Protest::Stories::Scenario.new(name)

      Protest::Stories.all[self].scenarios << scenario

      test(name) do
        @scenario = scenario
        instance_eval(&block)
      end
    end
  end
end