Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add a couple of examples (one pending) for errors in before(:each/:all)

  • Loading branch information...
commit b78129b34ae5f99b7873bc67667808b4e332b786 1 parent 68669a8
David Chelimsky dchelimsky authored
Showing with 20 additions and 1 deletion.
  1. +20 −1 spec/rspec/core/example_group_spec.rb
21 spec/rspec/core/example_group_spec.rb
View
@@ -243,7 +243,26 @@ module Rspec::Core
group.around(:each) { 'foo' }
group.should have(1).around_eachs
end
-
+
+ it "treats an error in before(:each) as a failure" do
+ group = ExampleGroup.describe
+ group.before(:each) { raise "error in before each" }
+ example = group.example("equality") { 1.should == 2}
+ group.run_all
+
+ example.metadata[:execution_result][:exception_encountered].message.should == "error in before each"
+ end
+
+ it "treats an error in before(:all) as a failure" do
+ pending("fix issue 21 - treat error in before all as failure") do
+ group = ExampleGroup.describe
+ group.before(:all) { raise "error in before all" }
+ example = group.example("equality") { 1.should == 2}
+ group.run_all
+
+ example.metadata[:execution_result][:exception_encountered].message.should == "error in before all"
+ end
+ end
end
describe "adding examples" do
Please sign in to comment.
Something went wrong with that request. Please try again.