Sha256: a18574bad6cd981d1847ed7c8f89bdac3502e19ba654ae3c26e9e60d25f85559

Contents?: true

Size: 709 Bytes

Versions: 1

Compression:

Stored size: 709 Bytes

Contents

require 'rspec/matchers'

begin
  require 'test/unit/assertionfailederror'
rescue LoadError
  module Test
    module Unit
      class AssertionFailedError < StandardError
      end
    end
  end
end

begin
  require "active_record"
rescue

end

Rspec::Matchers.define :redirect_to do |destination|
  match_unless_raises Test::Unit::AssertionFailedError do |_|
    assert_redirected_to destination
  end
end

Rspec::Matchers.define :render_template do |options, message|
  match_unless_raises Test::Unit::AssertionFailedError do |_|
    assert_template options, message
  end
end

Rspec::Matchers.define :be_a_new do |model_klass|
  match do |actual|
    model_klass === actual && actual.new_record?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-rails-2.0.0.beta.7 lib/rspec/rails/matchers.rb