missingly 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a83705cf44cec6dd38ce2c141dc8b01056c8c93
4
- data.tar.gz: 33d31bba15f08fb1ca5a7fe815a5c10d83763a54
3
+ metadata.gz: 329873650ee6e8398cbbe2fdffdc0bd50cfdb86e
4
+ data.tar.gz: e53cbe1ab5f8f623469d9998e94c1e97846a39cc
5
5
  SHA512:
6
- metadata.gz: 210ccf7b8492f0c25c09795578ee69a367a836e3e4878a10da0b1fb8eddce9c19bc3c30bf37843b9ead71762680bc76192fb65c37776cc046a2e3dac132301cc
7
- data.tar.gz: 6031dd4754856133dfcfa7f24fef13b47d152fdcc30e73eb2a593784cf5c0b6017fb0b9a9673dd6c2d863a4a944216c679122d82c1080d45a3ac90cb5487c021
6
+ metadata.gz: fc9eb219402ed99c8e77617e098441cd55002529617bd3d8db7e23938af30d0bf6ffcc49a7735aa76230017a9ad31e3a52c56d27df0c81e85eeb262336018983
7
+ data.tar.gz: 0dd2d6156ceacb869047598cbc8f112bbc1ed0cbaa1a5d9a93add4e1b18a9ba93a62ca2b55710b4a312c769b3729197ae8c4825691bf780fd763954bb328da26
@@ -108,7 +108,7 @@ module Missingly
108
108
  Missingly::Mutex.synchronize do
109
109
  missingly_methods_for_matcher(matcher.matchable) << method_name
110
110
 
111
- returned_value = matcher.define(self, method_name, *args, &block)
111
+ returned_value = matcher.define(self, method_name)
112
112
 
113
113
  missingly_subclasses.each do |subclass|
114
114
  subclass.undef_parent_missingly_methods matcher.matchable
@@ -1,3 +1,3 @@
1
1
  module Missingly
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -5,8 +5,8 @@ describe Missingly::Matchers do
5
5
  Class.new do
6
6
  include Missingly::Matchers
7
7
 
8
- handle_missingly [:find_by_name], class_method: true do |name|
9
- return {foo: 'bar'}
8
+ handle_missingly [:find_by_name], class_method: true do |method_name, *args|
9
+ return {foo: args.first || 'bar'}
10
10
  end
11
11
 
12
12
  handle_missingly /^find_all_by_(\w+)$/, class_method: true do |matches, *args, &block|
@@ -42,7 +42,7 @@ describe Missingly::Matchers do
42
42
  delegation_test.find_by_foo.should be_true
43
43
  end
44
44
 
45
- it "should not make class methods avliable to instances" do
45
+ it "should not make class methods available to instances" do
46
46
  search_class.new.respond_to?("find_by_name").should be_false
47
47
  lambda { search_class.new.find_by_name("foo") }.should raise_exception
48
48
  end
@@ -51,4 +51,8 @@ describe Missingly::Matchers do
51
51
  delegation_test.respond_to?("find_all_by_name").should be_true
52
52
  delegation_test.find_all_by_name.should be_a MatchData
53
53
  end
54
+
55
+ it "should accept method arguments" do
56
+ search_class.find_by_name("arg_test").should == {foo: "arg_test"}
57
+ end
54
58
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: missingly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thijs de Vries
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-13 00:00:00.000000000 Z
11
+ date: 2013-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler