test/progressrus_test.rb in progressrus-0.1.3 vs test/progressrus_test.rb in progressrus-0.1.4
- old
+ new
@@ -38,11 +38,11 @@
assert_equal 'oemg', progressrus.name
end
def test_initialize_with_persist
Progressrus.any_instance.expects(:persist).with(force: true).once
- progressrus = Progressrus.new(persist: true)
+ Progressrus.new(persist: true)
end
def test_tick_should_set_started_at_if_not_already_set_and_tick_greater_than_zero
@progress.tick
assert @progress.started_at
@@ -79,11 +79,11 @@
assert_equal 25, @progress.error_count
end
def test_eta_should_return_nil_if_no_count
progress = Progressrus.new
- assert_equal nil, progress.eta
+ assert_nil progress.eta
end
def test_eta_should_return_time_in_future_based_on_time_elapsed
time = Time.now
@progress.tick(10, now: time - 10)
@@ -130,15 +130,12 @@
assert_equal 10, elapsed
end
def test_to_serializeable_set_total_to_1_if_no_total
@progress.instance_variable_set(:@total, nil)
- assert_equal 1, @progress.to_serializeable[:total]
- end
- def test_total_when_total_is_nil_is_1
- @progress.instance_variable_set(:@total, nil)
- assert_equal 1, @progress.total
+ assert @progress.to_serializeable.key?(:total)
+ assert_nil @progress.to_serializeable[:total]
end
def test_to_serializeable_should_return_a_hash_of_options
progress = Progressrus.new(
name: 'Wally',