promise.rb 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDMwMDA0YTBhY2ZkMzE2MzVhNjBkMmQ4ZGRjN2M0MzRiODFkY2Q2OQ==
4
+ NGFmYWVmYmRmNWEyMjkyYmMwY2Y0NjA2OWE1YzBjZTM2NTlkNzFmMA==
5
5
  data.tar.gz: !binary |-
6
- MDI1ZDlhYzFmM2ViMzkwYzI0YzJhMTM4MDg3YmFhMzhjZjQ2YTcyMg==
6
+ ODg2NzU0ZjFmZTZjY2YzODFlYzJiYzUwMWE1OGQ2NWE4MGVlYTM0ZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODExMWZlZjg3YWNmMGM2ZmZhMGI4M2I0OTJlMjJkN2VkOTY4M2E5NjIzZDlj
10
- Nzk1Njc0NjQwNTUzMGJjMGJmZmJlOGNmNGI1YTFhZWZkNGMwNzM3ZjIzOGVm
11
- ZjBkN2NjMzIxZGFiYTk4OTBmOGUyOWMwYzVkMjRlNzY4OTBmNzc=
9
+ NzA4MmZhMGJiNTliYWIxZjQ5NmY1YTc2NTE5ZTQzY2Y1MTEzNzEyZGVjY2Yy
10
+ MjdkODk5ZGYxMjMwMjZiYjUzODdmZmY2YzIxNDk1M2Y3ZWQ1M2RkMjdhY2Jl
11
+ MTRhNzY2M2E4NWExNjY1OTg3OTYzYmI2NzY0MzZlNDE3ZmI2YWY=
12
12
  data.tar.gz: !binary |-
13
- MzBhMGVmODUzZTVmMTg2YjAwMDlmYmY5YTY5MTNlY2FiN2E5OWNiYWFkMzMx
14
- YTY2MTU5YzBlYWYyZWI2ZjBhOWM5Y2IzMjI4MTFkMTdlNTEwMzFkNWEzYjg3
15
- Zjg3NTAwZTc4NWNjODhiNGMyZjc4ZjJmNGFhMmE0ZmY4ZDZhZDk=
13
+ N2MxOTAzZWMzMmUyNGY4MTVhODEwZWYwODNhNmRkYmMwYjU1MWNjNTI3ZGQz
14
+ MTZhZDliZWQyZWRjNmVkN2E4MDA5YzhhZjBmMDkxMTYxNTQzYTRkZWU3N2Ix
15
+ MTgyZGMyZTNiMjJiMTczZDRmNTA4ZjEzMDE2MDZhMjc4YmI4ZWY=
data/Gemfile.devtools CHANGED
@@ -3,8 +3,6 @@
3
3
  group :development do
4
4
  gem 'rake', '~> 10.1.0'
5
5
  gem 'rspec', '~> 2.14.1'
6
- gem 'rspec-core', git: 'https://github.com/rspec/rspec-core.git',
7
- branch: '2-14-maintenance'
8
6
  gem 'yard', '~> 0.8.7'
9
7
  end
10
8
 
data/lib/promise.rb CHANGED
@@ -63,6 +63,13 @@ class Promise
63
63
  arg.freeze
64
64
  callbacks.each { |callback| defer(callback, arg) }
65
65
  end
66
+
67
+ # Callback#assume_state uses #dispatch as returned_promise's on_fulfill
68
+ # and on_reject callback. Without an explicit return value, the implicit
69
+ # return value might be the callbacks array, and thus returned_promise
70
+ # would be fulfilled (or rejected) with that array. It would be frozen
71
+ # from then on, letting further calls to #then crash.
72
+ nil
66
73
  end
67
74
 
68
75
  def maybe_dispatch(fulfill_callback, reject_callback)
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  class Promise
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
data/spec/promise_spec.rb CHANGED
@@ -332,4 +332,16 @@ describe Promise do
332
332
  expect(called).to eq(false)
333
333
  end
334
334
  end
335
+
336
+ describe '#fulfill' do
337
+ it 'does not return anything' do
338
+ expect(subject.fulfill(nil)).to eq(nil)
339
+ end
340
+ end
341
+
342
+ describe '#reject' do
343
+ it 'does not return anything' do
344
+ expect(subject.reject(nil)).to eq(nil)
345
+ end
346
+ end
335
347
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promise.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lars Gierth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-10 00:00:00.000000000 Z
11
+ date: 2013-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec