Sha256: 9260db9934b449b411993ec042dfa737729ff52d29678be8d749adb897a7cc8b

Contents?: true

Size: 671 Bytes

Versions: 8

Compression:

Stored size: 671 Bytes

Contents

require "test_helper"
require "hiccup/core_ext/duration"


class DurationExtTest < ActiveSupport::TestCase


  def test_active_support_duration_is_working
    assert 1.day.is_a?(ActiveSupport::Duration), "I ran into a problem where the Ruby gem 'god' also added :day to Fixnum and broke ActiveSupport."
  end


  def test_after_alias
    t = 17.weeks.ago
    [:day, :week, :month, :year].each do |period|
      assert_equal 1.send(period).since(t), 1.send(period).after(t)
    end
  end


  def test_before_alias
    t = 17.weeks.ago
    [:day, :week, :month, :year].each do |period|
      assert_equal 1.send(period).ago(t), 1.send(period).before(t)
    end
  end


end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hiccup-0.6.1 test/duration_ext_test.rb
hiccup-0.6.0 test/duration_ext_test.rb
hiccup-0.5.20 test/duration_ext_test.rb
hiccup-0.5.19 test/duration_ext_test.rb
hiccup-0.5.18 test/duration_ext_test.rb
hiccup-0.5.17 test/duration_ext_test.rb
hiccup-0.5.16 test/duration_ext_test.rb
hiccup-0.5.15 test/duration_ext_test.rb