1 require File.dirname(__FILE__) + '/../../spec_helper'
7 # @example = Example.new "example" do
12 # it "should tell you its docstring" do
13 # @example.description.should == "example"
16 # it "should execute its block in the context provided" do
17 # context = Class.new do
22 # @example.run_in(context).should == "foo"
26 # describe Example, "#description" do
27 # it "should default to NO NAME when not passed anything when there are no matchers" do
28 # example = Example.new {}
29 # example.run_in(Object.new)
30 # example.description.should == "NO NAME"
33 # it "should default to NO NAME description (Because of --dry-run) when passed nil and there are no matchers" do
34 # example = Example.new(nil) {}
35 # example.run_in(Object.new)
36 # example.description.should == "NO NAME"
39 # it "should allow description to be overridden" do
40 # example = Example.new("Test description")
41 # example.description.should == "Test description"
44 # it "should use description generated from matcher when there is no passed in description" do
45 # example = Example.new(nil) do
48 # example.run_in(Object.new)
49 # example.description.should == "should == 1"