Skip to content

Commit

Permalink
Moved a couple more error class definitions in to errors.rb.
Browse files Browse the repository at this point in the history
  • Loading branch information
myronmarston committed Oct 5, 2011
1 parent 5e4ef4c commit a403367
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
11 changes: 7 additions & 4 deletions lib/vcr/errors.rb
@@ -1,9 +1,12 @@
module VCR
module Errors
class Error < StandardError; end
class CassetteInUseError < Error; end
class TurnedOffError < Error; end
class MissingERBVariableError < Error; end
class Error < StandardError; end
class CassetteInUseError < Error; end
class TurnedOffError < Error; end
class MissingERBVariableError < Error; end
class LibraryVersionTooLowError < Error; end
class UnregisteredMatcherError < Error; end


class HTTPConnectionNotAllowedError < Error
def initialize(request)
Expand Down
4 changes: 1 addition & 3 deletions lib/vcr/request_matcher_registry.rb
@@ -1,6 +1,4 @@
module VCR
class UnregisteredMatcherError < ArgumentError; end

class RequestMatcherRegistry
DEFAULT_MATCHERS = [:method, :uri]

Expand Down Expand Up @@ -58,7 +56,7 @@ def uri_without_params(*ignores)
private

def raise_unregistered_matcher_error(name)
raise UnregisteredMatcherError.new \
raise Errors::UnregisteredMatcherError.new \
"There is no matcher registered for #{name.inspect}. " +
"Did you mean one of #{@registry.keys.map(&:inspect).join(', ')}?"
end
Expand Down
7 changes: 3 additions & 4 deletions lib/vcr/util/version_checker.rb
@@ -1,6 +1,4 @@
module VCR
class LibraryVersionTooLowError < StandardError; end

class VersionChecker
def initialize(library_name, library_version, min_patch_level, max_minor_version)
@library_name, @library_version = library_name, library_version
Expand Down Expand Up @@ -29,8 +27,9 @@ def too_high?
end

def raise_too_low_error
raise LibraryVersionTooLowError, "You are using #{@library_name} #{@library_version}. " +
"VCR requires version #{version_requirement}."
raise Errors::LibraryVersionTooLowError,
"You are using #{@library_name} #{@library_version}. " +
"VCR requires version #{version_requirement}."
end

def warn_about_too_high
Expand Down

0 comments on commit a403367

Please sign in to comment.