Sha256: 755c3097cf97f5f67198a12068a64f4f1a0a27ad44dae1e6238712ca8eccc4c3

Contents?: true

Size: 828 Bytes

Versions: 1

Compression:

Stored size: 828 Bytes

Contents

require File.join(File.dirname(__FILE__), "..", "test_helper")
require 'mocha/expectation_error'

class ExpectationErrorTest < Test::Unit::TestCase
  
  include Mocha
  
  def test_should_exclude_mocha_locations_from_backtrace
    mocha_lib = "/username/workspace/mocha_wibble/lib/"
    backtrace = [ mocha_lib + 'exclude/me/1', mocha_lib + 'exclude/me/2', '/keep/me', mocha_lib + 'exclude/me/3']
    expectation_error = ExpectationError.new(nil, backtrace, mocha_lib)
    assert_equal ['/keep/me'], expectation_error.backtrace
  end

  def test_should_determine_path_for_mocha_lib_directory
    assert_match Regexp.new("/lib/$"), ExpectationError::LIB_DIRECTORY
  end
  
  def test_should_set_error_message
    expectation_error = ExpectationError.new('message')
    assert_equal 'message', expectation_error.message
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mocha-0.5.6 test/unit/expectation_error_test.rb