progressrus 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/progressrus.rb +0 -4
- data/lib/progressrus/version.rb +1 -1
- data/test/integration_test.rb +8 -0
- data/test/progressrus_test.rb +4 -7
- data/test/store/redis_test.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1352b1b5be4da5d8a7132c00e12f05fe2433116e
|
4
|
+
data.tar.gz: 606d4001ebd436afae0bff0ef4befd07611092f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 610f86165a43ef101fc08c0eb9731de7e593a424abeafc476020c54b10d6e440c9c2c06e3e0f9d44f1a1689bb1380829c2fe967e16feaadc9f29275f3e2002e7
|
7
|
+
data.tar.gz: 1c69902b01e52a338fddc004881ce570d582af69c6f03d4ad821e3ca829658419a10e519efca5df0f8ca379284cd90ae89b01cdafd8ea8e70ad95f8d22d1d8e5
|
data/.gitignore
CHANGED
data/lib/progressrus.rb
CHANGED
data/lib/progressrus/version.rb
CHANGED
data/test/integration_test.rb
CHANGED
@@ -70,4 +70,12 @@ class IntegrationTest < Minitest::Test
|
|
70
70
|
assert_equal 0, ticks.first.count
|
71
71
|
assert_instance_of Time, ticks.first.failed_at
|
72
72
|
end
|
73
|
+
|
74
|
+
def test_unknown_count
|
75
|
+
progress = Progressrus.new(id: "omg", scope: ["walrus"], total: nil)
|
76
|
+
progress.tick
|
77
|
+
|
78
|
+
progress = Progressrus.find(["walrus"], "omg")
|
79
|
+
assert_nil progress.total
|
80
|
+
end
|
73
81
|
end
|
data/test/progressrus_test.rb
CHANGED
@@ -40,7 +40,7 @@ class ProgressrusTest < Minitest::Test
|
|
40
40
|
|
41
41
|
def test_initialize_with_persist
|
42
42
|
Progressrus.any_instance.expects(:persist).with(force: true).once
|
43
|
-
|
43
|
+
Progressrus.new(persist: true)
|
44
44
|
end
|
45
45
|
|
46
46
|
def test_tick_should_set_started_at_if_not_already_set_and_tick_greater_than_zero
|
@@ -81,7 +81,7 @@ class ProgressrusTest < Minitest::Test
|
|
81
81
|
|
82
82
|
def test_eta_should_return_nil_if_no_count
|
83
83
|
progress = Progressrus.new
|
84
|
-
|
84
|
+
assert_nil progress.eta
|
85
85
|
end
|
86
86
|
|
87
87
|
def test_eta_should_return_time_in_future_based_on_time_elapsed
|
@@ -132,12 +132,9 @@ class ProgressrusTest < Minitest::Test
|
|
132
132
|
|
133
133
|
def test_to_serializeable_set_total_to_1_if_no_total
|
134
134
|
@progress.instance_variable_set(:@total, nil)
|
135
|
-
assert_equal 1, @progress.to_serializeable[:total]
|
136
|
-
end
|
137
135
|
|
138
|
-
|
139
|
-
@progress.
|
140
|
-
assert_equal 1, @progress.total
|
136
|
+
assert @progress.to_serializeable.key?(:total)
|
137
|
+
assert_nil @progress.to_serializeable[:total]
|
141
138
|
end
|
142
139
|
|
143
140
|
def test_to_serializeable_should_return_a_hash_of_options
|
data/test/store/redis_test.rb
CHANGED
@@ -60,7 +60,7 @@ class RedisStoreTest < Minitest::Test
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def test_find_should_return_nil_if_nothing_is_found
|
63
|
-
|
63
|
+
assert_nil @store.find(@scope, 'oemg')
|
64
64
|
end
|
65
65
|
|
66
66
|
def test_flush_should_delete_by_scope
|
@@ -78,7 +78,7 @@ class RedisStoreTest < Minitest::Test
|
|
78
78
|
|
79
79
|
@store.flush(@scope, 'oemg')
|
80
80
|
|
81
|
-
|
81
|
+
assert_nil @store.find(@scope, 'oemg')
|
82
82
|
assert @store.find(@scope, 'oemg-two')
|
83
83
|
end
|
84
84
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: progressrus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Eskildsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|