Skip to content
Browse files

remove unnecessary (and unused) custom error classes

  • Loading branch information...
1 parent d03388f commit e031971317884815f2397c70ee9b02e467d0ef3c @dchelimsky dchelimsky committed Jan 9, 2012
View
2 lib/rspec/expectations/handler.rb
@@ -1,7 +1,5 @@
module RSpec
module Expectations
- class InvalidMatcherError < ArgumentError; end
-
class PositiveExpectationHandler
def self.handle_matcher(actual, matcher, message=nil, &block)
::RSpec::Matchers.last_should = :should
View
1 lib/rspec/matchers.rb
@@ -189,7 +189,6 @@ module Matchers
require 'rspec/matchers/eq'
require 'rspec/matchers/eql'
require 'rspec/matchers/equal'
-require 'rspec/matchers/errors'
require 'rspec/matchers/exist'
require 'rspec/matchers/generated_descriptions'
require 'rspec/matchers/has'
View
3 lib/rspec/matchers/change.rb
@@ -19,10 +19,9 @@ def matches?(event_proc)
end
def raise_block_syntax_error
- raise MatcherError.new(<<-MESSAGE
+ raise SyntaxError.new(<<-MESSAGE)
block passed to should or should_not change must use {} instead of do/end
MESSAGE
- )
end
def evaluate_value_proc
View
5 lib/rspec/matchers/errors.rb
@@ -1,5 +0,0 @@
-module RSpec
- module Matchers
- class MatcherError < StandardError; end
- end
-end
View
4 spec/rspec/matchers/change_spec.rb
@@ -171,7 +171,7 @@ def ==(other)
it "warns if passed a block using do/end instead of {}" do
expect do
expect {}.to change do; end
- end.to raise_error(RSpec::Matchers::MatcherError, /block passed to should or should_not/)
+ end.to raise_error(SyntaxError, /block passed to should or should_not/)
end
it "provides a #description" do
@@ -198,7 +198,7 @@ def ==(other)
it "warns if passed a block using do/end instead of {}" do
expect do
expect {}.to_not change do; end
- end.to raise_error(RSpec::Matchers::MatcherError, /block passed to should or should_not/)
+ end.to raise_error(SyntaxError, /block passed to should or should_not/)
end
end

0 comments on commit e031971

Please sign in to comment.
Something went wrong with that request. Please try again.