filtration 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/spec/filtration_spec.rb +1 -44
- metadata +2 -2
data/spec/filtration_spec.rb
CHANGED
@@ -133,49 +133,6 @@ describe Filtration do
|
|
133
133
|
|
134
134
|
end
|
135
135
|
|
136
|
-
context 'given an invalid target method' do
|
137
|
-
|
138
|
-
context 'and a code block for filtering' do
|
139
|
-
it 'raises an error' do
|
140
|
-
Class.new(Bad) do
|
141
|
-
extend RSpec::Matchers
|
142
|
-
expect { postfilter(:foo){|x| x * 2} }.to raise_error
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
context 'and a valid filter method' do
|
148
|
-
it 'raises an error' do
|
149
|
-
test = Class.new(Bad) do
|
150
|
-
extend RSpec::Matchers
|
151
|
-
expect { postfilter :foo, :double }.to raise_error
|
152
|
-
def double(x) x * 2; end
|
153
|
-
end
|
154
|
-
end
|
155
|
-
end
|
156
|
-
|
157
|
-
context 'and an invalid filter method' do
|
158
|
-
it 'raises an error' do
|
159
|
-
test = Class.new(Bad) do
|
160
|
-
extend RSpec::Matchers
|
161
|
-
expect { postfilter :foo, :double }.to raise_error
|
162
|
-
def double() 2; end
|
163
|
-
end
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
context 'and both a filter method and a block' do
|
168
|
-
it 'raises an error' do
|
169
|
-
test = Class.new(Bad) do
|
170
|
-
extend RSpec::Matchers
|
171
|
-
expect { postfilter(:foo,:double) {|x| x * 2} }.to raise_error
|
172
|
-
def double(x) x * 2; end
|
173
|
-
end
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
end
|
178
|
-
|
179
136
|
end
|
180
137
|
|
181
|
-
end
|
138
|
+
end
|