rest-more 0.7.1 → 0.7.2
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/.travis.yml +2 -1
- data/CHANGES.md +20 -0
- data/Gemfile +5 -1
- data/README.md +26 -0
- data/bin/rib-rest-core +22 -0
- data/example/rails2/Gemfile +1 -0
- data/example/rails2/app/views/application/helper.html.erb +1 -1
- data/example/rails2/config/environment.rb +10 -0
- data/example/rails2/config/rest-core.yaml +2 -2
- data/example/rails2/test/functional/application_controller_test.rb +3 -3
- data/example/rails2/test/unit/rails_util_test.rb +12 -7
- data/example/rails3/Gemfile +1 -0
- data/example/rails3/app/views/application/helper.html.erb +1 -1
- data/example/rails3/config/rest-core.yaml +2 -2
- data/example/rails3/test/functional/application_controller_test.rb +3 -3
- data/example/rails3/test/unit/rails_util_test.rb +12 -7
- data/lib/rest-core/client/bing.rb +92 -0
- data/lib/rest-core/client/bing/rails_util.rb +13 -0
- data/lib/rest-core/client/facebook.rb +2 -2
- data/lib/rest-core/client/facebook/rails_util.rb +28 -65
- data/lib/rest-core/client/flurry.rb +3 -3
- data/lib/rest-core/client/flurry/rails_util.rb +3 -64
- data/lib/rest-core/client/github.rb +3 -0
- data/lib/rest-core/client/github/rails_util.rb +13 -0
- data/lib/rest-core/client/linkedin.rb +2 -0
- data/lib/rest-core/client/linkedin/rails_util.rb +13 -0
- data/lib/rest-core/client/mixi.rb +2 -0
- data/lib/rest-core/client/mixi/rails_util.rb +13 -0
- data/lib/rest-core/client/twitter.rb +2 -0
- data/lib/rest-core/client/twitter/rails_util.rb +13 -0
- data/lib/rest-core/util/rails_util_util.rb +112 -5
- data/lib/rest-more.rb +4 -3
- data/lib/rest-more/version.rb +1 -1
- data/lib/rib/app/rest-core.rb +15 -0
- data/rest-more.gemspec +13 -4
- data/test/client/bing/test_api.rb +34 -0
- data/test/client/facebook/test_api.rb +12 -12
- data/test/client/facebook/test_cache.rb +3 -3
- data/test/client/facebook/test_default.rb +5 -5
- data/test/client/facebook/test_error.rb +25 -25
- data/test/client/facebook/test_handler.rb +12 -12
- data/test/client/facebook/test_load_config.rb +4 -4
- data/test/client/facebook/test_misc.rb +16 -16
- data/test/client/facebook/test_oauth.rb +3 -3
- data/test/client/facebook/test_old.rb +11 -11
- data/test/client/facebook/test_page.rb +4 -4
- data/test/client/facebook/test_parse.rb +14 -14
- data/test/client/facebook/test_serialize.rb +4 -4
- data/test/client/facebook/test_timeout.rb +4 -4
- data/test/client/flurry/test_metrics.rb +1 -1
- data/test/client/twitter/test_api.rb +1 -1
- metadata +16 -7
- data/lib/rest-core/client/simple.rb +0 -2
- data/lib/rest-core/client/universal.rb +0 -18
data/lib/rest-more.rb
CHANGED
@@ -4,10 +4,11 @@ require 'rest-core'
|
|
4
4
|
module RestCore
|
5
5
|
autoload :Config , 'rest-core/util/config'
|
6
6
|
|
7
|
+
autoload :Bing , 'rest-core/client/bing'
|
8
|
+
autoload :Facebook, 'rest-core/client/facebook'
|
9
|
+
autoload :Flurry , 'rest-core/client/flurry'
|
7
10
|
autoload :Github , 'rest-core/client/github'
|
8
|
-
autoload :Twitter , 'rest-core/client/twitter'
|
9
11
|
autoload :Linkedin, 'rest-core/client/linkedin'
|
10
|
-
autoload :Facebook, 'rest-core/client/facebook'
|
11
12
|
autoload :Mixi , 'rest-core/client/mixi'
|
12
|
-
autoload :
|
13
|
+
autoload :Twitter , 'rest-core/client/twitter'
|
13
14
|
end
|
data/lib/rest-more/version.rb
CHANGED
data/rest-more.gemspec
CHANGED
@@ -2,15 +2,16 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "rest-more"
|
5
|
-
s.version = "0.7.
|
5
|
+
s.version = "0.7.2"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = [
|
9
9
|
"Cardinal Blue",
|
10
10
|
"Lin Jen-Shin (godfat)"]
|
11
|
-
s.date = "2011-
|
11
|
+
s.date = "2011-11-05"
|
12
12
|
s.description = "Various REST clients such as Facebook and Twitter built with [rest-core][]\n\n[rest-core]: https://github.com/cardinalblue/rest-core"
|
13
13
|
s.email = ["dev (XD) cardinalblue.com"]
|
14
|
+
s.executables = ["rib-rest-core"]
|
14
15
|
s.files = [
|
15
16
|
".gitignore",
|
16
17
|
".gitmodules",
|
@@ -21,6 +22,7 @@ Gem::Specification.new do |s|
|
|
21
22
|
"README.md",
|
22
23
|
"Rakefile",
|
23
24
|
"TODO.md",
|
25
|
+
"bin/rib-rest-core",
|
24
26
|
"example/rails2/Gemfile",
|
25
27
|
"example/rails2/README",
|
26
28
|
"example/rails2/Rakefile",
|
@@ -61,24 +63,30 @@ Gem::Specification.new do |s|
|
|
61
63
|
"example/rails3/test/test_helper.rb",
|
62
64
|
"example/rails3/test/unit/rails_util_test.rb",
|
63
65
|
"example/sinatra/config.ru",
|
66
|
+
"lib/rest-core/client/bing.rb",
|
67
|
+
"lib/rest-core/client/bing/rails_util.rb",
|
64
68
|
"lib/rest-core/client/facebook.rb",
|
65
69
|
"lib/rest-core/client/facebook/rails_util.rb",
|
66
70
|
"lib/rest-core/client/flurry.rb",
|
67
71
|
"lib/rest-core/client/flurry/rails_util.rb",
|
68
72
|
"lib/rest-core/client/github.rb",
|
73
|
+
"lib/rest-core/client/github/rails_util.rb",
|
69
74
|
"lib/rest-core/client/linkedin.rb",
|
75
|
+
"lib/rest-core/client/linkedin/rails_util.rb",
|
70
76
|
"lib/rest-core/client/mixi.rb",
|
71
|
-
"lib/rest-core/client/
|
77
|
+
"lib/rest-core/client/mixi/rails_util.rb",
|
72
78
|
"lib/rest-core/client/twitter.rb",
|
73
|
-
"lib/rest-core/client/
|
79
|
+
"lib/rest-core/client/twitter/rails_util.rb",
|
74
80
|
"lib/rest-core/util/config.rb",
|
75
81
|
"lib/rest-core/util/rails_util_util.rb",
|
76
82
|
"lib/rest-more.rb",
|
77
83
|
"lib/rest-more/test.rb",
|
78
84
|
"lib/rest-more/version.rb",
|
85
|
+
"lib/rib/app/rest-core.rb",
|
79
86
|
"rest-more.gemspec",
|
80
87
|
"task/.gitignore",
|
81
88
|
"task/gemgem.rb",
|
89
|
+
"test/client/bing/test_api.rb",
|
82
90
|
"test/client/facebook/config/rest-core.yaml",
|
83
91
|
"test/client/facebook/test_api.rb",
|
84
92
|
"test/client/facebook/test_cache.rb",
|
@@ -101,6 +109,7 @@ Gem::Specification.new do |s|
|
|
101
109
|
s.rubygems_version = "1.8.11"
|
102
110
|
s.summary = "Various REST clients such as Facebook and Twitter built with [rest-core][]"
|
103
111
|
s.test_files = [
|
112
|
+
"test/client/bing/test_api.rb",
|
104
113
|
"test/client/facebook/test_api.rb",
|
105
114
|
"test/client/facebook/test_cache.rb",
|
106
115
|
"test/client/facebook/test_default.rb",
|
@@ -0,0 +1,34 @@
|
|
1
|
+
|
2
|
+
require 'rest-more/test'
|
3
|
+
|
4
|
+
describe RC::Bing do
|
5
|
+
after do
|
6
|
+
WebMock.reset!
|
7
|
+
RR.verify
|
8
|
+
end
|
9
|
+
|
10
|
+
def stub_with body, query={}
|
11
|
+
stub_request(:get, 'http://api.bing.net/json.aspx').
|
12
|
+
with(:query => {'JsonType' => 'raw', 'Version' => '2.2'}.merge(query)).
|
13
|
+
to_return(:body => body)
|
14
|
+
end
|
15
|
+
|
16
|
+
should 'get right' do
|
17
|
+
stub_with('{"status":"OK"}')
|
18
|
+
RC::Bing.new.get('').should.eq({'status' => 'OK'})
|
19
|
+
end
|
20
|
+
|
21
|
+
should 'be able to set AppId' do
|
22
|
+
RC::Bing.new(:AppId => 'QQ').AppId.should.eq 'QQ'
|
23
|
+
end
|
24
|
+
|
25
|
+
should 'use AppId for requests' do
|
26
|
+
stub_with('{}', 'AppId' => 'zz')
|
27
|
+
RC::Bing.new(:AppId => 'zz').get('').should.eq({})
|
28
|
+
end
|
29
|
+
|
30
|
+
should 'raise correct error' do
|
31
|
+
stub_with('{"SearchResponse":{"Errors":[{"Code":2003}]}}')
|
32
|
+
lambda{RC::Bing.new.get('')}.should.raise(RC::Bing::Error::NoAccess)
|
33
|
+
end
|
34
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
require 'rest-more/test'
|
3
3
|
|
4
|
-
describe
|
4
|
+
describe RC::Facebook do
|
5
5
|
after do
|
6
6
|
WebMock.reset!
|
7
7
|
RR.verify
|
@@ -9,7 +9,7 @@ describe RestCore::Facebook do
|
|
9
9
|
|
10
10
|
should 'generate correct url' do
|
11
11
|
TestHelper.normalize_url(
|
12
|
-
|
12
|
+
RC::Facebook.new(:access_token => 'awesome').
|
13
13
|
url('path', :query => 'str')).should.eq \
|
14
14
|
'https://graph.facebook.com/path?access_token=awesome&query=str'
|
15
15
|
end
|
@@ -24,10 +24,10 @@ describe RestCore::Facebook do
|
|
24
24
|
{'User-Agent' => 'Ruby'})). # this is by ruby
|
25
25
|
to_return(:body => '{"data": []}')
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
RC::Facebook.new(:site => 'http://nothing.godfat.org/',
|
28
|
+
:lang => 'zh-tw',
|
29
|
+
:accept => 'text/plain').
|
30
|
+
get('me').should.eq({'data' => []})
|
31
31
|
end
|
32
32
|
|
33
33
|
should 'pass custom headers' do
|
@@ -41,7 +41,7 @@ describe RestCore::Facebook do
|
|
41
41
|
{'User-Agent' => 'Ruby'})). # this is by ruby
|
42
42
|
to_return(:body => '{"data": []}')
|
43
43
|
|
44
|
-
|
44
|
+
RC::Facebook.new.get('http://example.com', {},
|
45
45
|
{:headers => {'X-Forwarded-For' => '127.0.0.1'}} ).
|
46
46
|
should.eq({'data' => []})
|
47
47
|
end
|
@@ -50,7 +50,7 @@ describe RestCore::Facebook do
|
|
50
50
|
stub_request(:post, 'https://graph.facebook.com/feed/me').
|
51
51
|
with(:body => 'message=hi%20there').to_return(:body => 'ok')
|
52
52
|
|
53
|
-
|
53
|
+
RC::Facebook.new(:json_decode => false).
|
54
54
|
post('feed/me', :message => 'hi there').should == 'ok'
|
55
55
|
end
|
56
56
|
|
@@ -59,7 +59,7 @@ describe RestCore::Facebook do
|
|
59
59
|
'https://graph.facebook.com/me?access_token=1|2').
|
60
60
|
to_return(:body => 'ok')
|
61
61
|
|
62
|
-
rg =
|
62
|
+
rg = RC::Facebook.new(
|
63
63
|
:json_decode => false, :access_token => 'wrong',
|
64
64
|
:app_id => '1', :secret => '2')
|
65
65
|
rg.get('me', {}, :secret => true).should.eq 'ok'
|
@@ -73,7 +73,7 @@ describe RestCore::Facebook do
|
|
73
73
|
stub_request(:get, 'https://graph.facebook.com/woot').
|
74
74
|
to_return(:body => 'bad json')
|
75
75
|
|
76
|
-
rg =
|
76
|
+
rg = RC::Facebook.new(:json_decode => true)
|
77
77
|
rg.get('woot', {}, :json_decode => false).should.eq 'bad json'
|
78
78
|
rg.json_decode.should == true
|
79
79
|
end
|
@@ -83,7 +83,7 @@ describe RestCore::Facebook do
|
|
83
83
|
stub_request(:delete, 'https://graph.facebook.com/123').to_return(
|
84
84
|
:body => '[]', :status => status)
|
85
85
|
|
86
|
-
|
86
|
+
RC::Facebook.new.delete('123').should.eq []
|
87
87
|
}
|
88
88
|
end
|
89
89
|
|
@@ -91,7 +91,7 @@ describe RestCore::Facebook do
|
|
91
91
|
stub(o = Object.new).to_s{ 'i am mock' }
|
92
92
|
stub_request(:get, "https://graph.facebook.com/search?q=i%20am%20mock").
|
93
93
|
to_return(:body => 'ok')
|
94
|
-
|
94
|
+
RC::Facebook.new(:json_decode => false).
|
95
95
|
get('search', :q => o).should.eq 'ok'
|
96
96
|
end
|
97
97
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
require 'rest-more/test'
|
3
3
|
|
4
|
-
describe
|
4
|
+
describe RC::Facebook do
|
5
5
|
after do
|
6
6
|
WebMock.reset!
|
7
7
|
RR.verify
|
@@ -12,7 +12,7 @@ describe RestCore::Facebook do
|
|
12
12
|
@url, @body = "https://graph.facebook.com/cache", '{"message":"ok"}'
|
13
13
|
@cache_key = Digest::MD5.hexdigest(@url)
|
14
14
|
@cache = {}
|
15
|
-
@rg =
|
15
|
+
@rg = RC::Facebook.new(:cache => @cache, :json_decode => false)
|
16
16
|
stub_request(:get, @url).to_return(:body => @body).times(1)
|
17
17
|
end
|
18
18
|
|
@@ -44,7 +44,7 @@ describe RestCore::Facebook do
|
|
44
44
|
stub_request(meth, url).to_return(:body => body).times(3)
|
45
45
|
|
46
46
|
cache = {}
|
47
|
-
rg =
|
47
|
+
rg = RC::Facebook.new(:cache => cache)
|
48
48
|
3.times{
|
49
49
|
if meth == :delete
|
50
50
|
rg.send(meth, 'cache').should.eq({'message' => 'ok'})
|
@@ -1,17 +1,17 @@
|
|
1
1
|
|
2
2
|
require 'rest-more/test'
|
3
3
|
|
4
|
-
describe
|
4
|
+
describe RC::Facebook do
|
5
5
|
should 'honor default attributes' do
|
6
|
-
|
6
|
+
RC::Facebook.members.reject{ |name|
|
7
7
|
name.to_s =~ /method$|handler$|detector$/ }.each{ |name|
|
8
|
-
|
9
|
-
|
8
|
+
RC::Facebook.new.send(name).should ==
|
9
|
+
RC::Facebook.new.send("default_#{name}")
|
10
10
|
}
|
11
11
|
end
|
12
12
|
|
13
13
|
should 'use module to override default attributes' do
|
14
|
-
klass =
|
14
|
+
klass = RC::Facebook.dup
|
15
15
|
klass.send(:include, Module.new do
|
16
16
|
def default_app_id
|
17
17
|
'1829'
|
@@ -1,63 +1,63 @@
|
|
1
1
|
|
2
2
|
require 'rest-more/test'
|
3
3
|
|
4
|
-
describe
|
4
|
+
describe RC::Facebook::Error do
|
5
5
|
after do
|
6
6
|
WebMock.reset!
|
7
7
|
RR.verify
|
8
8
|
end
|
9
9
|
|
10
10
|
should 'have the right ancestors' do
|
11
|
-
|
11
|
+
RC::Facebook::Error::AccessToken.should.lt RC::Facebook::Error
|
12
12
|
|
13
|
-
|
14
|
-
|
13
|
+
RC::Facebook::Error::InvalidAccessToken.should.lt \
|
14
|
+
RC::Facebook::Error::AccessToken
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
RC::Facebook::Error::MissingAccessToken.should.lt \
|
17
|
+
RC::Facebook::Error::AccessToken
|
18
18
|
end
|
19
19
|
|
20
20
|
def error2env hash
|
21
|
-
{
|
22
|
-
|
23
|
-
|
21
|
+
{RC::RESPONSE_BODY => hash,
|
22
|
+
RC::REQUEST_PATH => '/' ,
|
23
|
+
RC::REQUEST_QUERY => {}}
|
24
24
|
end
|
25
25
|
|
26
26
|
should 'parse right' do
|
27
27
|
%w[OAuthInvalidTokenException OAuthException].each{ |type|
|
28
|
-
|
29
|
-
should.kind_of?(
|
28
|
+
RC::Facebook::Error.call(error2env('error' => {'type' => type})).
|
29
|
+
should.kind_of?(RC::Facebook::Error::InvalidAccessToken)
|
30
30
|
}
|
31
31
|
|
32
|
-
|
32
|
+
RC::Facebook::Error.call(
|
33
33
|
error2env('error'=>{'type' =>'QueryParseException',
|
34
34
|
'message'=>'An active access token..'})).
|
35
|
-
should.kind_of?(
|
35
|
+
should.kind_of?(RC::Facebook::Error::MissingAccessToken)
|
36
36
|
|
37
|
-
|
37
|
+
RC::Facebook::Error.call(
|
38
38
|
error2env('error'=>{'type' =>'QueryParseException',
|
39
39
|
'message'=>'Oh active access token..'})).
|
40
|
-
should.not.kind_of?(
|
40
|
+
should.not.kind_of?(RC::Facebook::Error::MissingAccessToken)
|
41
41
|
|
42
|
-
|
43
|
-
should.kind_of?(
|
42
|
+
RC::Facebook::Error.call(error2env('error_code' => 190)).
|
43
|
+
should.kind_of?(RC::Facebook::Error::InvalidAccessToken)
|
44
44
|
|
45
|
-
|
46
|
-
should.kind_of?(
|
45
|
+
RC::Facebook::Error.call(error2env('error_code' => 104)).
|
46
|
+
should.kind_of?(RC::Facebook::Error::MissingAccessToken)
|
47
47
|
|
48
|
-
|
49
|
-
should.not.kind_of?(
|
48
|
+
RC::Facebook::Error.call(error2env('error_code' => 999)).
|
49
|
+
should.not.kind_of?(RC::Facebook::Error::AccessToken)
|
50
50
|
|
51
|
-
error =
|
52
|
-
error.should.not.kind_of?(
|
53
|
-
error.should .kind_of?(
|
51
|
+
error = RC::Facebook::Error.call(error2env(['not a hash']))
|
52
|
+
error.should.not.kind_of?(RC::Facebook::Error::AccessToken)
|
53
|
+
error.should .kind_of?(RC::Facebook::Error)
|
54
54
|
end
|
55
55
|
|
56
56
|
should 'nuke cache upon errors' do
|
57
57
|
stub_request(:get, 'https://graph.facebook.com/me').
|
58
58
|
to_return(:body => '{"error":"wrong"}').times(2)
|
59
59
|
|
60
|
-
rg =
|
60
|
+
rg = RC::Facebook.new(:cache => {},
|
61
61
|
:error_handler => lambda{|env|env})
|
62
62
|
rg.get('me'); rg.get('me')
|
63
63
|
rg.cache.values.should.eq []
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
require 'rest-more/test'
|
3
3
|
|
4
|
-
describe
|
4
|
+
describe RC::Facebook do
|
5
5
|
after do
|
6
6
|
WebMock.reset!
|
7
7
|
RR.verify
|
@@ -13,7 +13,7 @@ describe RestCore::Facebook do
|
|
13
13
|
to_return(:body => '{}')
|
14
14
|
|
15
15
|
logger = []
|
16
|
-
rg =
|
16
|
+
rg = RC::Facebook.new(:log_method => lambda{ |s| logger << [s] })
|
17
17
|
rg.get('me')
|
18
18
|
|
19
19
|
logger.size.should.eq 1
|
@@ -24,21 +24,21 @@ describe RestCore::Facebook do
|
|
24
24
|
before do
|
25
25
|
@id = lambda{ |env| env }
|
26
26
|
@error = '{"error":{"type":"Exception","message":"(#2500)"}}'
|
27
|
-
@error_hash =
|
27
|
+
@error_hash = RC::JsonDecode.json_decode(@error)
|
28
28
|
|
29
29
|
stub_request(:get, 'https://graph.facebook.com/me').
|
30
30
|
to_return(:body => @error)
|
31
31
|
end
|
32
32
|
|
33
33
|
should 'call error_handler if error occurred' do
|
34
|
-
|
34
|
+
RC::Facebook.new(:error_handler => @id).get('me').
|
35
35
|
should.eq @error_hash
|
36
36
|
end
|
37
37
|
|
38
|
-
should 'raise ::
|
38
|
+
should 'raise ::RC::Facebook::Error in default error_handler' do
|
39
39
|
begin
|
40
|
-
|
41
|
-
rescue ::
|
40
|
+
RC::Facebook.new.get('me')
|
41
|
+
rescue ::RC::Facebook::Error => e
|
42
42
|
e.error .should.eq @error_hash
|
43
43
|
e.message.should.eq \
|
44
44
|
"#{@error_hash.inspect} from https://graph.facebook.com/me"
|
@@ -56,7 +56,7 @@ describe RestCore::Facebook do
|
|
56
56
|
before do
|
57
57
|
@id = lambda{ |env| env }
|
58
58
|
@fql_error = '{"error_code":603,"error_msg":"Unknown table: bad"}'
|
59
|
-
@fql_error_hash =
|
59
|
+
@fql_error_hash = RC::JsonDecode.json_decode(@fql_error)
|
60
60
|
|
61
61
|
@bad_fql_query = 'SELECT name FROM bad_table WHERE uid="12345"'
|
62
62
|
bad_fql_request = "https://api.facebook.com/method/fql.query?" \
|
@@ -66,14 +66,14 @@ describe RestCore::Facebook do
|
|
66
66
|
end
|
67
67
|
|
68
68
|
should 'call error_handler if error occurred' do
|
69
|
-
|
69
|
+
RC::Facebook.new(:error_handler => @id).fql(@bad_fql_query).
|
70
70
|
should.eq @fql_error_hash
|
71
71
|
end
|
72
72
|
|
73
|
-
should 'raise ::
|
73
|
+
should 'raise ::RC::Facebook::Error in default error_handler' do
|
74
74
|
begin
|
75
|
-
|
76
|
-
rescue ::
|
75
|
+
RC::Facebook.new.fql(@bad_fql_query)
|
76
|
+
rescue ::RC::Facebook::Error => e
|
77
77
|
e.error .should.eq @fql_error_hash
|
78
78
|
e.message.should.start_with?(
|
79
79
|
"#{@fql_error_hash.inspect} from " \
|
@@ -3,10 +3,10 @@ require 'rest-more/test'
|
|
3
3
|
|
4
4
|
require 'rest-core/util/config'
|
5
5
|
|
6
|
-
describe
|
6
|
+
describe RC::Config do
|
7
7
|
|
8
8
|
before do
|
9
|
-
@klass =
|
9
|
+
@klass = RC::Facebook.dup
|
10
10
|
end
|
11
11
|
|
12
12
|
after do
|
@@ -24,12 +24,12 @@ describe RestCore::Config do
|
|
24
24
|
app = Object.new
|
25
25
|
mock(app).env { 'test' }
|
26
26
|
mock(app).root{ File.dirname(__FILE__) }
|
27
|
-
|
27
|
+
RC::Config.load_for_rails(@klass, 'facebook', app)
|
28
28
|
check
|
29
29
|
end
|
30
30
|
|
31
31
|
should 'honor config' do
|
32
|
-
|
32
|
+
RC::Config.load(
|
33
33
|
@klass,
|
34
34
|
"#{File.dirname(__FILE__)}/config/rest-core.yaml",
|
35
35
|
'test',
|