Class: Mongoid::TestCase

Inherits:
ActiveSupport::TestCase
  • Object
show all
Defined in:
lib/mongoid_rails_fixtures/mongoid_ext/test_case.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#assert_date_from_db(expected, actual, message = nil) ⇒ Object



3
4
5
# File 'lib/mongoid_rails_fixtures/mongoid_ext/test_case.rb', line 3

def assert_date_from_db(expected, actual, message = nil)
  assert_equal expected.to_s, actual.to_s, message
end

#with_kcode(kcode) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/mongoid_rails_fixtures/mongoid_ext/test_case.rb', line 7

def with_kcode(kcode)
  if RUBY_VERSION < '1.9'
    orig_kcode, $KCODE = $KCODE, kcode
    begin
      yield
    ensure
      $KCODE = orig_kcode
    end
  else
    yield
  end
end