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 !
deprecated ExampleMethods#implementation_backtrace - use 
ExampleMethods#backtrace instead [#609 state:resolved]
dchelimsky (author)
Thu Nov 20 19:57:38 -0800 2008
commit  931aa93fdf62c12388c4389601b739a7e723320f
tree    c4174296337d9a7506e54abcbba6b06c361c7d27
parent  19f6fb98fe540c5a79ac85a405f39cc6e90b06fd
...
1
2
 
 
 
 
3
4
5
6
7
8
9
 
10
11
12
13
14
 
15
16
17
...
1
2
3
4
5
6
7
8
9
10
11
12
 
13
14
15
16
17
 
18
19
20
21
0
@@ -1,17 +1,21 @@
0
 === Maintenance
0
 
0
+* 1 deprecation
0
+
0
+  * deprecated ExampleMethods#implementation_backtrace - use ExampleMethods#backtrace instead
0
+
0
 * 3 major enhancements
0
 
0
   * it { should matcher } - support for implicit receiver of #should (Joe Ferris of thoughtbot)
0
   * subject { ... } - works in conjunction with implicit receiver of #should
0
   * wrap_expectation (for wrapping multiple expectations and/or t/u assertions)
0
 
0
-* 1 minor enhancement
0
+* 2 minor enhancements
0
 
0
   * should throw_symbol accepts an optional argument: should throw_symbol(:sym, arg)
0
   * fixed --line for jruby (Zach Moazeni)
0
   
0
-* 2 bug fixes
0
+* 3 bug fixes
0
 
0
   * fixed bug where {:a => 1, :b => 2}.should include(:a, :b) failed (Yossef Mendelssohn)
0
   * only try to load Test::Unit if Test::Unit is defined
...
4
5
6
7
 
8
9
10
...
64
65
66
67
 
68
69
70
71
72
73
74
 
75
76
77
78
79
80
 
81
82
83
...
110
111
112
113
 
114
115
116
 
117
118
119
 
 
 
 
 
 
 
 
120
121
122
...
4
5
6
 
7
8
9
10
...
64
65
66
 
67
68
69
70
71
72
73
 
74
75
76
77
78
79
 
80
81
82
83
...
110
111
112
 
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
0
@@ -4,7 +4,7 @@ module Spec
0
       
0
       extend ModuleReopeningFix
0
       
0
-      def subject # :nodoc:
0
+      def subject # :nodoc: this is somewhat experimental
0
         @subject ||= ( instance_variable_get(subject_variable_name) ||
0
                        instance_eval(&self.class.subject_block) ||
0
                        (described_class ? described_class.new : nil) )
0
@@ -64,20 +64,20 @@ module Spec
0
         success = execution_error.nil? || ExamplePendingError === execution_error
0
       end
0
 
0
-      def instance_variable_hash
0
+      def instance_variable_hash # :nodoc:
0
         instance_variables.inject({}) do |variable_hash, variable_name|
0
           variable_hash[variable_name] = instance_variable_get(variable_name)
0
           variable_hash
0
         end
0
       end
0
 
0
-      def eval_each_fail_fast(examples) #:nodoc:
0
+      def eval_each_fail_fast(examples) # :nodoc:
0
         examples.each do |example|
0
           instance_eval(&example)
0
         end
0
       end
0
 
0
-      def eval_each_fail_slow(examples) #:nodoc:
0
+      def eval_each_fail_slow(examples) # :nodoc:
0
         first_exception = nil
0
         examples.each do |example|
0
           begin
0
@@ -110,13 +110,22 @@ module Spec
0
         end
0
       end
0
 
0
-      def eval_block
0
+      def eval_block # :nodoc:
0
         instance_eval(&@_implementation)
0
       end
0
 
0
+      # Provides the backtrace up to where this example was declared.
0
       def backtrace
0
         @backtrace
0
       end
0
+      
0
+      def implementation_backtrace
0
+        Kernel.warn <<-WARNING
0
+ExampleMethods#implementation_backtrace is deprecated and will be removed
0
+from a future version. Please use ExampleMethods#backtrace instead.
0
+WARNING
0
+        backtrace
0
+      end
0
 
0
       private
0
       include Matchers
...
170
171
172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
174
175
...
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
0
@@ -170,6 +170,28 @@ module Spec
0
           end
0
         end
0
       end
0
+      
0
+      describe "#implementation_backtrace (deprecated)" do
0
+        with_sandboxed_options do
0
+          before(:each) do
0
+            Kernel.stub!(:warn)
0
+          end
0
+
0
+          it "sends a deprecation warning" do
0
+            example_group = Class.new(ExampleGroup) {}
0
+            example = example_group.example("") {}
0
+            Kernel.should_receive(:warn).with(/#implementation_backtrace.*deprecated.*#backtrace instead/m)
0
+            example.implementation_backtrace
0
+          end
0
+          
0
+          it "delegates to #backtrace" do
0
+            example_group = Class.new(ExampleGroup) {}
0
+            example = example_group.example("") {}
0
+            example.should_receive(:backtrace)
0
+            example.implementation_backtrace
0
+          end
0
+        end
0
+      end
0
 
0
       describe "#full_description" do
0
         it "should return the full description of the ExampleGroup and Example" do

Comments