Sha256: bd7ecd0805b4720b7f08fedc5c831209cee57574adfefd76721c0bc8baea13d6

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

module ::RSpec::Mocks
  unless Opal::RSpec::Compatibility.constant_resolution_works_right?
    class MockExpectationError < Exception
    end

    # Raised when a test double is used after it has been torn
    # down (typically at the end of an rspec-core example).
    class ExpiredTestDoubleError < MockExpectationError
    end

    # Raised when doubles or partial doubles are used outside of the per-test lifecycle.
    class OutsideOfExampleError < StandardError
    end

    # @private
    class UnsupportedMatcherError < StandardError
    end

    # @private
    class NegationUnsupportedError < StandardError
    end

    # @private
    class VerifyingDoubleNotDefinedError < StandardError
    end
  end

  class ErrorGenerator
    def actual_method_call_args_description(count, args)
      method_call_args_description(args) ||
          if count > 0 && args.length > 0
            # \A and \z not supported on Opal
            # " with arguments: #{args.inspect.gsub(/\A\[(.+)\]\z/, '(\1)')}"
            " with arguments: #{args.inspect.gsub(/^\[(.+)\]$/, '(\1)')}"
          else
            ""
          end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
opal-connect-rspec-0.5.0 opal/opal/rspec/fixes/rspec/mocks/error_generator.rb
opal-rspec-0.5.0 opal/opal/rspec/fixes/rspec/mocks/error_generator.rb
opal-rspec-0.5.0.beta3 opal/opal/rspec/fixes/rspec/mocks/error_generator.rb