changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/spec/spec/example/example_spec.rb

changeset 15: 64acf98d15f4
author: moriq@moriq.com
date: Mon Mar 10 10:12:58 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec
1require File.dirname(__FILE__) + '/../../spec_helper'
2
3module Spec
4 module Example
5 # describe Example do
6 # before(:each) do
7 # @example = Example.new "example" do
8 # foo
9 # end
10 # end
11 #
12 # it "should tell you its docstring" do
13 # @example.description.should == "example"
14 # end
15 #
16 # it "should execute its block in the context provided" do
17 # context = Class.new do
18 # def foo
19 # "foo"
20 # end
21 # end.new
22 # @example.run_in(context).should == "foo"
23 # end
24 # end
25 #
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"
31 # end
32 #
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"
37 # end
38 #
39 # it "should allow description to be overridden" do
40 # example = Example.new("Test description")
41 # example.description.should == "Test description"
42 # end
43 #
44 # it "should use description generated from matcher when there is no passed in description" do
45 # example = Example.new(nil) do
46 # 1.should == 1
47 # end
48 # example.run_in(Object.new)
49 # example.description.should == "should == 1"
50 # end
51 # end
52 end
53end