miga-base 1.0.5.5 → 1.1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/test/common_test.rb CHANGED
@@ -78,21 +78,21 @@ class CommonTest < Test::Unit::TestCase
78
78
 
79
79
  # Check advance when missing total
80
80
  o = capture_stderr { m.advance('x', 0) }.string
81
- assert_match(/\] x *\r/, o)
81
+ assert_match(%r{\] x *\r}, o)
82
82
 
83
83
  # Initialize advance
84
- o = capture_stderr { m.advance('x', 0, 10) }.string
85
- assert_match(/\] x 0\.0% \(0\/10\) *\r/, o)
84
+ o = capture_stderr { m.advance('x', 0, 1001) }.string
85
+ assert_match(%r{\] x 0\.0% \(0/1001\) *\r}, o)
86
86
 
87
87
  # Insufficient data for prediction
88
88
  sleep(1)
89
- o = capture_stderr { m.advance('x', 1, 10) }.string
90
- assert_match(/\] x 10\.0% \(1\/10\) *\r/, o)
89
+ o = capture_stderr { m.advance('x', 1, 1000) }.string
90
+ assert_match(%r{\] x 0\.1% \(1/1000\) *\r}, o)
91
91
 
92
92
  # Predict time
93
93
  sleep(1)
94
- o = capture_stderr { m.advance('x', 2, 10) }.string
95
- assert_match(/\] x 20\.0% \(2\/10\) [7-9]s left *\r/, o)
94
+ o = capture_stderr { m.advance('x', 2, 1000) }.string
95
+ assert_match(%r{\] x 0\.2% \(2/1000\) 1\d\.\dm left *\r}, o)
96
96
  end
97
97
 
98
98
  def test_num_suffix