spec/lib/bluepill/system_spec.rb in bluepill-0.0.63 vs spec/lib/bluepill/system_spec.rb in bluepill-0.0.64
- old
+ new
@@ -31,6 +31,15 @@
Bluepill::System.store[:anotherkey] = Faker::Lorem.sentence
Bluepill::System.reset_data
Bluepill::System.store.should be_empty
end
end
+
+ describe :parse_etime do
+ it "should parse etime format" do
+ Bluepill::System.parse_elapsed_time("400-00:04:01").should be_equal(34560241)
+ Bluepill::System.parse_elapsed_time("02:04:02").should be_equal(7442)
+ Bluepill::System.parse_elapsed_time("20:03").should be_equal(1203)
+ Bluepill::System.parse_elapsed_time("invalid").should be_equal(0)
+ end
+ end
end