Upgraded Rails and RSpec
[monkeycharger.git] / vendor / plugins / rspec / spec / spec / dsl / example_class_spec.rb
blobd55795cb4e5b353c30b07e21c3617bb506d1ba75
1 require File.dirname(__FILE__) + '/../../spec_helper.rb'
3 module Spec
4   module DSL
5     describe Example, " class" do
7       def run(example)
8         example.run(@reporter, nil, nil, nil, Object.new)
9       end
11       before do
12         @reporter = stub("reporter", :example_started => nil, :example_finished => nil)
13         @example_class = Example.dup
14       end
15       
16       it "should report errors in example" do
17         error = Exception.new
18         @reporter.should_receive(:example_finished).with("example", error, "example", false)
20         run(@example_class.new("example") {raise(error)})
21       end
22     end
23   end
24 end