Skip to content

Commit

Permalink
implement respond_to_missing? properly for future
Browse files Browse the repository at this point in the history
  • Loading branch information
godfat committed Jan 29, 2016
1 parent 48e534f commit bf37a26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rest-core/promise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ def initialize promise, key
def method_missing msg, *args, &block
@promise.yield[@key].__send__(msg, *args, &block)
end

def respond_to_missing? msg, *args, &block
@promise.yield[@key].respond_to?(msg, *args, &block)
end
end

def future_status ; Future.new(self, RESPONSE_STATUS ); end
Expand Down
1 change: 1 addition & 0 deletions test/test_future.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
promise.future_headers .should.eq('A' => 'B')
promise.future_socket .should.kind_of?(StringIO)
promise.future_failures.should.eq []
([] + promise.future_failures).should.eq []
end
end

0 comments on commit bf37a26

Please sign in to comment.