Sha256: 43de3045283f9777dde0ce2a211ca24139e810d1e405d7c69755e572c5371800

Contents?: true

Size: 758 Bytes

Versions: 22

Compression:

Stored size: 758 Bytes

Contents

require "helper"
require "spring/process_title_updater"
require "active_support/time"

class ProcessTitleUpdaterTest < ActiveSupport::TestCase
  setup do
    @start   = Time.local(2012, 2, 12, 4, 3, 12)
    @updater = Spring::ProcessTitleUpdater.new(@start) { }
  end

  test "seconds" do
    assert_equal "1 sec",  @updater.distance_in_words(@start + 1.second)
    assert_equal "2 secs", @updater.distance_in_words(@start + 2.seconds)
  end

  test "minutes" do
    assert_equal "1 min",  @updater.distance_in_words(@start + 1.minute + 10.seconds)
    assert_equal "5 mins", @updater.distance_in_words(@start + 5.minutes + 10.seconds)
  end

  test "hours" do
    assert_equal "6 hours",  @updater.distance_in_words(@start + 6.hours + 50.minutes)
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
spring-1.3.3 test/unit/process_title_updater_test.rb
spring-1.3.2 test/unit/process_title_updater_test.rb
spring-1.3.1 test/unit/process_title_updater_test.rb
spring-1.3.0 test/unit/process_title_updater_test.rb
spring-1.2.0 test/unit/process_title_updater_test.rb
spring-1.1.3 test/unit/process_title_updater_test.rb
spring-1.1.2 test/unit/process_title_updater_test.rb
spring-1.1.1 test/unit/process_title_updater_test.rb
spring-1.1.0 test/unit/process_title_updater_test.rb
spring-1.1.0.beta4 test/unit/process_title_updater_test.rb
spring-1.1.0.beta3 test/unit/process_title_updater_test.rb
spring-1.1.0.beta2 test/unit/process_title_updater_test.rb
spring-1.1.0.beta1 test/unit/process_title_updater_test.rb
spring-1.0.0 test/unit/process_title_updater_test.rb
spring-0.9.2 test/unit/process_title_updater_test.rb
spring-0.9.1 test/unit/process_title_updater_test.rb
spring-0.9.0 test/unit/process_title_updater_test.rb
spring-0.0.11 test/unit/process_title_updater_test.rb
spring-0.0.10 test/unit/process_title_updater_test.rb
spring-0.0.9 test/unit/process_title_updater_test.rb