futuroscope 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/futuroscope/future.rb +1 -1
- data/lib/futuroscope/version.rb +1 -1
- data/spec/futuroscope/future_spec.rb +9 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a472750ba1f0d8f4ecd235cf7320b0351369fcbf
|
4
|
+
data.tar.gz: fb27ab2a0769f68ea1c3870bafb812ae2591ae45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c10d72125eabfe267a48f6bc0a3c5c9d144da4d6727f42a6500957025bfcd666c8b10e51c53b57aebfb23b2b0099d3537e4e9770b4b6918d4bf85e139903eab
|
7
|
+
data.tar.gz: e2abc633d1b80451e82bfeb4189e21b4490f3032300249560dd0e034c961dde0a247acfe102f37b5380c154419855f87abafecb31f69c9986917a421d057a6fb
|
data/lib/futuroscope/future.rb
CHANGED
data/lib/futuroscope/version.rb
CHANGED
@@ -27,8 +27,8 @@ module Futuroscope
|
|
27
27
|
expect(future.class).to eq(Array)
|
28
28
|
expect(future).to be_kind_of(Enumerable)
|
29
29
|
expect(future).to be_a(Enumerable)
|
30
|
-
expect(future.clone).to eq(object)
|
31
30
|
expect(future.to_s).to eq(object.to_s)
|
31
|
+
expect(Future.new { nil }).to be_nil
|
32
32
|
end
|
33
33
|
|
34
34
|
it "delegates missing methods" do
|
@@ -66,6 +66,14 @@ module Futuroscope
|
|
66
66
|
expect(future.dup).to eq future
|
67
67
|
end
|
68
68
|
|
69
|
+
it "clones correctly before being resolved" do
|
70
|
+
object = [1, 2, 3]
|
71
|
+
future = Future.new { sleep 1; object }
|
72
|
+
clone = future.clone
|
73
|
+
|
74
|
+
expect(clone).to eq object
|
75
|
+
end
|
76
|
+
|
69
77
|
context "when at least another thread is alive" do
|
70
78
|
# If no threads are alive, the VM raises an exception, therefore we need to ensure there is one.
|
71
79
|
|