Permalink
Browse files

ran into a situation where method missing was not passing the block w…

…hich was

causing array#sort_by to return an enumerator instead of an array
  • Loading branch information...
1 parent 70be44e commit c4e1201cb5b0e9edc5983f0c7bad67576c59f617 @rauhryan rauhryan committed Jan 25, 2012
Showing with 4 additions and 2 deletions.
  1. +2 −2 lib/ghee/resource_proxy.rb
  2. +2 −0 spec/ghee/api/repos_spec.rb
@@ -33,8 +33,8 @@ def initialize(connection, path_prefix, params = {})
# message - Message object
# args* - Arguements passed
#
- def method_missing(message, *args)
- subject.send(message, *args)
+ def method_missing(message, *args, &block)
+ subject.send(message, *args, &block)
end
# Subject is the response body parsed
@@ -22,6 +22,8 @@ def should_be_a_repo(repo)
it "should return issues for repo" do
VCR.use_cassette("repo(#{GH_USER},#{GH_REPO}).issues") do
issues = subject.repos(GH_USER, GH_REPO).issues
+ puts issues.sort_by! { |r| r["title"]}.reverse
+ issues.is_a?(Array).should be_true
issues.size.should > 0
issues.first["title"].should_not be_nil
end

0 comments on commit c4e1201

Please sign in to comment.