Sha256: 17f49048abe130c91d933052a6a425524cdc70a84954da217886cfd0a954d010

Contents?: true

Size: 687 Bytes

Versions: 21

Compression:

Stored size: 687 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

21 entries across 21 versions & 1 rubygems

Version Path
hiccup-0.5.14 test/duration_ext_test.rb
hiccup-0.5.13 test/duration_ext_test.rb
hiccup-0.5.12 test/duration_ext_test.rb
hiccup-0.5.11 test/duration_ext_test.rb
hiccup-0.5.10 test/duration_ext_test.rb
hiccup-0.5.9 test/duration_ext_test.rb
hiccup-0.5.8 test/duration_ext_test.rb
hiccup-0.5.7 test/duration_ext_test.rb
hiccup-0.5.6 test/duration_ext_test.rb
hiccup-0.5.5 test/duration_ext_test.rb
hiccup-0.5.4 test/duration_ext_test.rb
hiccup-0.5.3 test/duration_ext_test.rb
hiccup-0.5.2 test/duration_ext_test.rb
hiccup-0.5.1 test/duration_ext_test.rb
hiccup-0.5.0 test/duration_ext_test.rb
hiccup-0.4.5 test/duration_ext_test.rb
hiccup-0.4.4 test/duration_ext_test.rb
hiccup-0.4.3 test/duration_ext_test.rb
hiccup-0.4.2 test/duration_ext_test.rb
hiccup-0.4.1 test/duration_ext_test.rb