public
Rubygem
Description: The official `github` command line helper for simplifying your GitHub experience.
Homepage: http://github.com
Clone URL: git://github.com/defunkt/github-gem.git
Reverting change to spec/spec_helper.rb. The change was originally made so 
the tests could run on earlier version of rspec (<1.1.4)
snowblink (author)
Thu Jul 03 12:51:21 -0700 2008
commit  b8fb20e08848a6a5668c285aa032315ebfd4ff33
tree    aa8567f582278edb1e85c3351289ccfe66fb8899
parent  67048556a30c6756d3301fd8ed4c34feebcf2ffe
...
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
 
 
 
 
 
 
 
 
 
65
 
 
 
 
66
67
68
69
 
 
 
70
71
72
73
74
75
76
77
78
 
 
 
 
 
 
 
 
79
80
81
82
 
 
 
83
84
85
86
87
88
89
90
91
 
 
 
 
 
92
93
 
94
95
96
...
47
48
49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
 
 
 
65
66
67
68
 
 
 
 
 
 
 
 
69
70
71
72
73
74
75
76
77
 
 
 
78
79
80
81
 
 
 
 
 
 
 
 
82
83
84
85
86
87
88
89
90
91
92
0
@@ -47,50 +47,46 @@ class Class
0
   end
0
 end
0
 
0
-module Spec
0
- module Example
0
- module ExampleGroupSubclassMethods
0
- def add_guard(klass, name, is_class = false)
0
- guarded = nil # define variable now for scoping
0
- target = (is_class ? klass.metaclass : klass)
0
- sep = (is_class ? "." : "#")
0
- target.class_eval do
0
- guarded = instance_method(name)
0
- define_method name do |*args|
0
- raise "Testing guards violated: Cannot call #{klass}#{sep}#{name}"
0
- end
0
- end
0
- @guards ||= []
0
- @guards << [klass, name, is_class, guarded]
0
+module Spec::Example::ExampleGroupSubclassMethods
0
+ def add_guard(klass, name, is_class = false)
0
+ guarded = nil # define variable now for scoping
0
+ target = (is_class ? klass.metaclass : klass)
0
+ sep = (is_class ? "." : "#")
0
+ target.class_eval do
0
+ guarded = instance_method(name)
0
+ define_method name do |*args|
0
+ raise "Testing guards violated: Cannot call #{klass}#{sep}#{name}"
0
       end
0
+ end
0
+ @guards ||= []
0
+ @guards << [klass, name, is_class, guarded]
0
+ end
0
 
0
- def add_class_guard(klass, name)
0
- add_guard(klass, name, true)
0
- end
0
+ def add_class_guard(klass, name)
0
+ add_guard(klass, name, true)
0
+ end
0
 
0
- def unguard(klass, name, is_class = false)
0
- row = @guards.find { |(k,n,i)| k == klass and n == name and i == is_class }
0
- raise "#{klass}#{is_class ? "." : "#"}#{name} is not guarded" if row.nil?
0
- (is_class ? klass.metaclass : klass).class_eval do
0
- define_method name, row.last
0
- end
0
- @guards.delete row
0
- end
0
+ def unguard(klass, name, is_class = false)
0
+ row = @guards.find { |(k,n,i)| k == klass and n == name and i == is_class }
0
+ raise "#{klass}#{is_class ? "." : "#"}#{name} is not guarded" if row.nil?
0
+ (is_class ? klass.metaclass : klass).class_eval do
0
+ define_method name, row.last
0
+ end
0
+ @guards.delete row
0
+ end
0
 
0
- def class_unguard(klass, name)
0
- unguard(klass, name, true)
0
- end
0
+ def class_unguard(klass, name)
0
+ unguard(klass, name, true)
0
+ end
0
 
0
- def unguard_all
0
- @guards ||= []
0
- @guards.each do |klass, name, is_class, guarded|
0
- (is_class ? klass.metaclass : klass).class_eval do
0
- define_method name, guarded
0
- end
0
- end
0
- @guards.clear
0
+ def unguard_all
0
+ @guards ||= []
0
+ @guards.each do |klass, name, is_class, guarded|
0
+ (is_class ? klass.metaclass : klass).class_eval do
0
+ define_method name, guarded
0
       end
0
     end
0
+ @guards.clear
0
   end
0
 end
0
 

Comments

    No one has commented yet.