expectations 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/lib/expectations/blank_slate.rb +9 -11
- data/rakefile.rb +1 -1
- data/test/successes_test.rb +3 -0
- metadata +1 -1
data/README
CHANGED
@@ -178,4 +178,4 @@ expectations can be used for state based and behavior based testing.
|
|
178
178
|
|
179
179
|
== Contributors
|
180
180
|
|
181
|
-
Matt Mower, Ola Bini, George Malamidis, Brian Guthrie, Philippe Hanrigou, Steve McLarnon
|
181
|
+
Matt Mower, Ola Bini, George Malamidis, Brian Guthrie, Philippe Hanrigou, Steve McLarnon, Rubikitch
|
@@ -58,12 +58,11 @@ end
|
|
58
58
|
#
|
59
59
|
module Kernel
|
60
60
|
class << self
|
61
|
-
alias_method :blank_slate_method_added, :method_added
|
62
|
-
|
63
61
|
# Detect method additions to Kernel and remove them in the
|
64
62
|
# BlankSlate class.
|
65
|
-
|
66
|
-
|
63
|
+
unbound_method = method(:method_added)
|
64
|
+
define_method :method_added do |name|
|
65
|
+
result = unbound_method.call(name)
|
67
66
|
return result if self != Kernel
|
68
67
|
BlankSlate.hide(name)
|
69
68
|
result
|
@@ -76,12 +75,11 @@ end
|
|
76
75
|
#
|
77
76
|
class Object
|
78
77
|
class << self
|
79
|
-
alias_method :blank_slate_method_added, :method_added
|
80
|
-
|
81
78
|
# Detect method additions to Object and remove them in the
|
82
79
|
# BlankSlate class.
|
83
|
-
|
84
|
-
|
80
|
+
unbound_method = method(:method_added)
|
81
|
+
define_method :method_added do |name|
|
82
|
+
result = unbound_method.call(name)
|
85
83
|
return result if self != Object
|
86
84
|
BlankSlate.hide(name)
|
87
85
|
result
|
@@ -101,9 +99,9 @@ end
|
|
101
99
|
# exposed in the first place.
|
102
100
|
#
|
103
101
|
class Module
|
104
|
-
|
105
|
-
|
106
|
-
result =
|
102
|
+
unbound_method = instance_method(:append_features)
|
103
|
+
define_method :append_features do |mod|
|
104
|
+
result = unbound_method.bind(self).call(mod)
|
107
105
|
return result if mod != Object
|
108
106
|
instance_methods.each do |name|
|
109
107
|
BlankSlate.hide(name)
|
data/rakefile.rb
CHANGED
@@ -46,7 +46,7 @@ specification = Gem::Specification.new do |s|
|
|
46
46
|
expect NoMethodError do
|
47
47
|
Object.invalid_method_call
|
48
48
|
end."
|
49
|
-
s.version = "0.2.
|
49
|
+
s.version = "0.2.6"
|
50
50
|
s.author = 'Jay Fields'
|
51
51
|
s.description = "A lightweight unit testing framework. Tests (expectations) will be written as follows
|
52
52
|
expect 2 do
|
data/test/successes_test.rb
CHANGED