public
Description: Behaviour Driven Development framework for Ruby
Homepage: http://rspec.info
Clone URL: git://github.com/dchelimsky/rspec.git
Search Repo:
Click here to lend your support to: rspec and make a donation at www.pledgie.com !
Cleaning up Formatter. Making migrations less fragile to different 
versions of Rails.
btakita (author)
Wed May 21 23:29:42 -0700 2008
commit  beb5131eefaf891d9168b3dcab745a1f0ba23db4
tree    9236e8139ca80d6919866e9340bf9eee13f7d733
parent  fa5228c4213849870231b0da371ddbef39a4982d
...
4
5
6
7
8
9
10
11
12
13
14
15
...
4
5
6
 
 
 
 
 
 
7
8
9
0
@@ -4,12 +4,6 @@ module Spec
0
   module Runner
0
     module Formatter
0
       class FailingExampleGroupsFormatter < BaseTextFormatter
0
- attr_reader :example_group
0
- def add_example_group(example_group)
0
- super
0
- @example_group = example_group
0
- end
0
-
0
         def example_failed(example, counter, failure)
0
           if @example_group
0
             description_parts = @example_group.description_parts.collect do |description|
...
9
10
11
12
13
 
 
14
15
16
...
18
19
20
21
22
 
 
23
24
25
26
27
 
 
28
29
30
...
39
40
41
42
43
 
 
44
45
46
47
48
49
 
50
51
52
...
57
58
59
60
 
61
62
63
...
71
72
73
74
 
75
76
77
...
87
88
89
90
 
91
92
93
...
110
111
112
113
 
114
115
116
...
9
10
11
 
 
12
13
14
15
16
...
18
19
20
 
 
21
22
23
24
25
 
 
26
27
28
29
30
...
39
40
41
 
 
42
43
44
45
46
47
48
 
49
50
51
52
...
57
58
59
 
60
61
62
63
...
71
72
73
 
74
75
76
77
...
87
88
89
 
90
91
92
93
...
110
111
112
 
113
114
115
116
0
@@ -9,8 +9,8 @@ module Spec
0
         
0
         def initialize(options, output)
0
           super
0
- @current_example_group_number = 0
0
- @current_example_number = 0
0
+ @example_group_number = 0
0
+ @example_number = 0
0
         end
0
         
0
         def method_missing(sym, *args)
0
@@ -18,13 +18,13 @@ module Spec
0
         end
0
 
0
         # The number of the currently running example_group
0
- def current_example_group_number
0
- @current_example_group_number
0
+ def example_group_number
0
+ @example_group_number
0
         end
0
         
0
         # The number of the currently running example (a global counter)
0
- def current_example_number
0
- @current_example_number
0
+ def example_number
0
+ @example_number
0
         end
0
         
0
         def start(example_count)
0
@@ -39,14 +39,14 @@ module Spec
0
           super
0
           @example_group_red = false
0
           @example_group_red = false
0
- @current_example_group_number += 1
0
- unless current_example_group_number == 1
0
+ @example_group_number += 1
0
+ unless example_group_number == 1
0
             @output.puts " </dl>"
0
             @output.puts "</div>"
0
           end
0
           @output.puts "<div class=\"example_group\">"
0
           @output.puts " <dl>"
0
- @output.puts " <dt id=\"example_group_#{current_example_group_number}\">#{h(example_group.description)}</dt>"
0
+ @output.puts " <dt id=\"example_group_#{example_group_number}\">#{h(example_group.description)}</dt>"
0
           @output.flush
0
         end
0
 
0
@@ -57,7 +57,7 @@ module Spec
0
         end
0
 
0
         def example_started(example)
0
- @current_example_number += 1
0
+ @example_number += 1
0
         end
0
 
0
         def example_passed(example)
0
@@ -71,7 +71,7 @@ module Spec
0
           failure_style = failure.pending_fixed? ? 'pending_fixed' : 'failed'
0
           @output.puts " <script type=\"text/javascript\">makeRed('rspec-header');</script>" unless @header_red
0
           @header_red = true
0
- @output.puts " <script type=\"text/javascript\">makeRed('example_group_#{current_example_group_number}');</script>" unless @example_group_red
0
+ @output.puts " <script type=\"text/javascript\">makeRed('example_group_#{example_group_number}');</script>" unless @example_group_red
0
           @example_group_red = true
0
           move_progress
0
           @output.puts " <dd class=\"spec #{failure_style}\">"
0
@@ -87,7 +87,7 @@ module Spec
0
 
0
         def example_pending(example, message)
0
           @output.puts " <script type=\"text/javascript\">makeYellow('rspec-header');</script>" unless @header_red
0
- @output.puts " <script type=\"text/javascript\">makeYellow('example_group_#{current_example_group_number}');</script>" unless @example_group_red
0
+ @output.puts " <script type=\"text/javascript\">makeYellow('example_group_#{example_group_number}');</script>" unless @example_group_red
0
           move_progress
0
           @output.puts " <dd class=\"spec not_implemented\"><span class=\"not_implemented_spec_name\">#{h(example.description)} (PENDING: #{h(message)})</span></dd>"
0
           @output.flush
0
@@ -110,7 +110,7 @@ module Spec
0
         def percent_done
0
           result = 100.0
0
           if @example_count != 0
0
- result = ((current_example_number).to_f / @example_count.to_f * 1000).to_i / 10.0
0
+ result = ((example_number).to_f / @example_count.to_f * 1000).to_i / 10.0
0
           end
0
           result
0
         end
...
6
7
8
9
 
10
11
12
...
6
7
8
 
9
10
11
12
0
@@ -6,7 +6,7 @@ module Spec
0
       TINY = 3
0
       RELEASE_CANDIDATE = nil
0
 
0
- BUILD_TIME_UTC = 20080504004334
0
+ BUILD_TIME_UTC = 20080522044210
0
 
0
       STRING = [MAJOR, MINOR, TINY].join('.')
0
       TAG = "REL_#{[MAJOR, MINOR, TINY, RELEASE_CANDIDATE].compact.join('_')}".upcase.gsub(/\.|-/, '_')

Comments

    No one has commented yet.