Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Pending spec for shared context that exposes Issue #632

  • Loading branch information...
commit 5fc19b6203dbdf19158a158002bec7b1957a1e6e 1 parent 5f730b0
Tejas Dinkar authored June 12, 2012

Showing 1 changed file with 22 additions and 0 deletions. Show diff stats Hide diff stats

  1. 22  spec/rspec/core/shared_context_spec.rb
22  spec/rspec/core/shared_context_spec.rb
@@ -34,6 +34,28 @@
34 34
     after_all_hook.should be_true
35 35
   end
36 36
 
  37
+  it "runs the before each hooks in configuration before those of the shared context" do
  38
+    ordered_hooks = []
  39
+    RSpec.configure do |c|
  40
+      c.before(:each) { ordered_hooks << "config" }
  41
+    end
  42
+
  43
+    RSpec.world.shared_context "before each stuff", :example => :before_each_hook_order do
  44
+      before(:each) { ordered_hooks << "shared_context"}
  45
+    end
  46
+
  47
+    group = RSpec::Core::ExampleGroup.describe :example => :before_each_hook_order do
  48
+      before(:each) { ordered_hooks << "example_group" }
  49
+      example {}
  50
+    end
  51
+
  52
+    group.run
  53
+
  54
+    pending "Issue #632" do
  55
+      ordered_hooks.should == ["config", "shared_context", "example_group"]
  56
+    end
  57
+  end
  58
+
37 59
   it "supports let" do
38 60
     shared = Module.new do
39 61
       extend RSpec::SharedContext

0 notes on commit 5fc19b6

Please sign in to comment.
Something went wrong with that request. Please try again.