public
Description: Behaviour Driven Development framework for Ruby
Homepage: http://rspec.info
Clone URL: git://github.com/dchelimsky/rspec.git
Click here to lend your support to: rspec and make a donation at www.pledgie.com !
Apply before_suite_parts *after* loading files! [#459 state:resolved 
milestone:"1.1.5"]
dchelimsky (author)
Sat Jul 12 15:04:40 -0700 2008
commit  74fd2a7e6893e95a6d4706b1dcf209e436cf7d1e
tree    831d9170de2de3121f99a8c303fd48eb1beb44e9
parent  c516321f3e90f87d0a839745060e0580aa60073d
...
54
55
56
57
 
58
59
60
...
89
90
91
92
93
94
95
96
97
...
99
100
101
 
 
 
 
 
 
 
 
 
102
103
104
...
54
55
56
 
57
58
59
60
...
89
90
91
 
 
 
92
93
94
...
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
0
@@ -54,7 +54,7 @@ module Spec
0
         :argv
0
       )
0
       attr_reader :colour, :differ_class, :files, :example_groups
0
-
0
+      
0
       def initialize(error_stream, output_stream)
0
         @error_stream = error_stream
0
         @output_stream = output_stream
0
@@ -89,9 +89,6 @@ module Spec
0
         return true unless examples_should_be_run?
0
         success = true
0
         begin
0
-          before_suite_parts.each do |part|
0
-            part.call
0
-          end
0
           runner = custom_runner || ExampleGroupRunner.new(self)
0
 
0
           unless @files_loaded
0
@@ -99,6 +96,15 @@ module Spec
0
             @files_loaded = true
0
           end
0
 
0
+          # TODO - this has to happen after the files get loaded,
0
+          # otherwise the before_suite_parts are not populated
0
+          # from the configuration. There is no spec for this
0
+          # directly, but stories/configuration/before_blocks.story
0
+          # will fail if this happens before the files are loaded.
0
+          before_suite_parts.each do |part|
0
+            part.call
0
+          end
0
+
0
           if example_groups.empty?
0
             true
0
           else
...
13
14
15
16
17
18
19
20
...
13
14
15
 
 
16
17
18
0
@@ -13,8 +13,6 @@ Story: before suite
0
     
0
   Scenario: running with spec
0
 
0
-    Given this scenario fails because before(:suite) doesn't get run with the spec command
0
-
0
     Given the file ../resources/spec/before_blocks_example.rb
0
 
0
     When I run it with the spec script

Comments