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 +4 -4
- data/lib/missingly/matchers.rb +1 -1
- data/lib/missingly/version.rb +1 -1
- data/spec/class_methods_spec.rb +7 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 329873650ee6e8398cbbe2fdffdc0bd50cfdb86e
|
4
|
+
data.tar.gz: e53cbe1ab5f8f623469d9998e94c1e97846a39cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc9eb219402ed99c8e77617e098441cd55002529617bd3d8db7e23938af30d0bf6ffcc49a7735aa76230017a9ad31e3a52c56d27df0c81e85eeb262336018983
|
7
|
+
data.tar.gz: 0dd2d6156ceacb869047598cbc8f112bbc1ed0cbaa1a5d9a93add4e1b18a9ba93a62ca2b55710b4a312c769b3729197ae8c4825691bf780fd763954bb328da26
|
data/lib/missingly/matchers.rb
CHANGED
@@ -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
|
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
|
data/lib/missingly/version.rb
CHANGED
data/spec/class_methods_spec.rb
CHANGED
@@ -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 |
|
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
|
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.
|
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-
|
11
|
+
date: 2013-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|