expectations 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
- def method_added(name)
66
- result = blank_slate_method_added(name)
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
- def method_added(name)
84
- result = blank_slate_method_added(name)
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
- alias blankslate_original_append_features append_features
105
- def append_features(mod)
106
- result = blankslate_original_append_features(mod)
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.5"
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
@@ -130,4 +130,7 @@ Expectations do
130
130
  process.finished = true
131
131
  end
132
132
 
133
+ expect nil.to.be.nil?
134
+ expect Object.not.to.be.nil?
135
+
133
136
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expectations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Fields