reviewed 0.1.21 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/reviewed/client.rb +1 -6
- data/lib/reviewed/version.rb +1 -1
- data/spec/client_spec.rb +2 -4
- metadata +1 -1
data/lib/reviewed/client.rb
CHANGED
@@ -17,12 +17,7 @@ module Reviewed
|
|
17
17
|
|
18
18
|
def resource(name)
|
19
19
|
klass_string = "Reviewed::#{name.to_s.singularize.classify}"
|
20
|
-
|
21
|
-
begin
|
22
|
-
klass = klass_string.constantize
|
23
|
-
rescue
|
24
|
-
raise "Resource: #{klass_string} not found"
|
25
|
-
end
|
20
|
+
klass_string.constantize rescue name
|
26
21
|
end
|
27
22
|
|
28
23
|
def method_missing(method, *args, &block)
|
data/lib/reviewed/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -43,10 +43,8 @@ describe Reviewed::Client do
|
|
43
43
|
|
44
44
|
context 'constant does not exist' do
|
45
45
|
|
46
|
-
it '
|
47
|
-
|
48
|
-
client.resource("tester")
|
49
|
-
}.to raise_error
|
46
|
+
it 'returns the string' do
|
47
|
+
client.resource("foobar").should eql("foobar")
|
50
48
|
end
|
51
49
|
end
|
52
50
|
end
|