futuroscope 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4fd5d28ef251a17a7ef93724aeb9bd633c7918e5
4
- data.tar.gz: b99fa961184a443c7fcc68c3e547536bfa8295c6
3
+ metadata.gz: a472750ba1f0d8f4ecd235cf7320b0351369fcbf
4
+ data.tar.gz: fb27ab2a0769f68ea1c3870bafb812ae2591ae45
5
5
  SHA512:
6
- metadata.gz: 216febe1e1ef8ea9041cbdb053dd2d5aa926e12a30056bff728e48947931436e59160c9d1ca50bec0cafc0a4579f9e804b8887cba6270d324c0ac595370691ae
7
- data.tar.gz: 702c1d669a4b74cc126aacac0cbf3841651737588b8c6068ae6f12d1aa01536698933856c80825ae33112881824e75fa923846c84b973c9b905710064bd885be
6
+ metadata.gz: 3c10d72125eabfe267a48f6bc0a3c5c9d144da4d6727f42a6500957025bfcd666c8b10e51c53b57aebfb23b2b0099d3537e4e9770b4b6918d4bf85e139903eab
7
+ data.tar.gz: e2abc633d1b80451e82bfeb4189e21b4490f3032300249560dd0e034c961dde0a247acfe102f37b5380c154419855f87abafecb31f69c9986917a421d057a6fb
@@ -64,7 +64,7 @@ module Futuroscope
64
64
  @resolved_future = value
65
65
  end
66
66
 
67
- def_delegators :__getobj__, :class, :kind_of?, :is_a?, :clone
67
+ def_delegators :__getobj__, :class, :kind_of?, :is_a?, :nil?
68
68
 
69
69
  alias_method :future_value, :__getobj__
70
70
 
@@ -1,3 +1,3 @@
1
1
  module Futuroscope
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
@@ -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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: futuroscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy