Permalink
Browse files

テスト実行毎設定.

  • Loading branch information...
1 parent d370823 commit b778b969a62c79c29fbcbcc569ba6b8b9329dffa @bananagi bananagi committed May 3, 2011
View
6 spec/oauth/helpers/basic_helper_spec.rb
@@ -11,6 +11,7 @@
OpensocialWap::OAuth::Helpers::BasicHelper.configure do
consumer_key 'sample_consumer_key'
consumer_secret 'sample_consumer_secret'
+ proxy_class OpensocialWap::OAuth::RequestProxy::OAuthRackRequestProxy
end
oauth_helper = OpensocialWap::OAuth::Helpers::BasicHelper.new(request)
@@ -29,6 +30,7 @@
OpensocialWap::OAuth::Helpers::BasicHelper.configure do
consumer_key 'sample_consumer_key'
consumer_secret 'sample_consumer_secret'
+ proxy_class OpensocialWap::OAuth::RequestProxy::OAuthRackRequestProxy
end
oauth_helper = OpensocialWap::OAuth::Helpers::BasicHelper.new(request)
@@ -46,6 +48,7 @@
OpensocialWap::OAuth::Helpers::BasicHelper.configure do
consumer_key 'sample_consumer_key'
consumer_secret 'foobar'
+ proxy_class OpensocialWap::OAuth::RequestProxy::OAuthRackRequestProxy
end
oauth_helper = OpensocialWap::OAuth::Helpers::BasicHelper.new(request)
result = oauth_helper.verify
@@ -65,6 +68,7 @@
OpensocialWap::OAuth::Helpers::BasicHelper.configure do
consumer_key 'sample_consumer_key'
consumer_secret 'sample_consumer_secret'
+ proxy_class OpensocialWap::OAuth::RequestProxy::OAuthRackRequestProxy
end
oauth_helper = OpensocialWap::OAuth::Helpers::BasicHelper.new(request)
result = oauth_helper.verify
@@ -84,6 +88,7 @@
OpensocialWap::OAuth::Helpers::BasicHelper.configure do
consumer_key 'sample_consumer_key'
consumer_secret 'sample_consumer_secret'
+ proxy_class OpensocialWap::OAuth::RequestProxy::OAuthRackRequestProxy
end
oauth_helper = OpensocialWap::OAuth::Helpers::BasicHelper.new(request)
result = oauth_helper.verify
@@ -102,6 +107,7 @@
OpensocialWap::OAuth::Helpers::BasicHelper.configure do
consumer_key 'sample_consumer_key'
consumer_secret 'foobar'
+ proxy_class OpensocialWap::OAuth::RequestProxy::OAuthRackRequestProxy
end
oauth_helper = OpensocialWap::OAuth::Helpers::BasicHelper.new(request)
result = oauth_helper.verify
View
7 spec/rack/opensocial_oauth_spec.rb
@@ -10,6 +10,7 @@
helper_class = OpensocialWap::OAuth::Helpers::BasicHelper.configure do
consumer_key 'sample_consumer_key'
consumer_secret 'sample_consumer_secret'
+ proxy_class OpensocialWap::OAuth::RequestProxy::OAuthRackRequestProxy
end
opts = {:helper_class => helper_class}
rack = OpensocialWap::Rack::OpensocialOauth.new(nil, opts)
@@ -29,6 +30,7 @@
helper_class = OpensocialWap::OAuth::Helpers::BasicHelper.configure do
consumer_key 'sample_consumer_key'
consumer_secret 'sample_consumer_secret'
+ proxy_class OpensocialWap::OAuth::RequestProxy::OAuthRackRequestProxy
end
opts = {:helper_class => helper_class}
rack = OpensocialWap::Rack::OpensocialOauth.new(nil, opts)
@@ -47,6 +49,7 @@
helper_class = OpensocialWap::OAuth::Helpers::BasicHelper.configure do
consumer_key 'sample_consumer_key'
consumer_secret 'foobar'
+ proxy_class OpensocialWap::OAuth::RequestProxy::OAuthRackRequestProxy
end
opts = {:helper_class => helper_class}
rack = OpensocialWap::Rack::OpensocialOauth.new(nil, opts)
@@ -68,6 +71,7 @@
helper_class = OpensocialWap::OAuth::Helpers::BasicHelper.configure do
consumer_key 'sample_consumer_key'
consumer_secret 'sample_consumer_secret'
+ proxy_class OpensocialWap::OAuth::RequestProxy::OAuthRackRequestProxy
end
opts = {:helper_class => helper_class}
rack = OpensocialWap::Rack::OpensocialOauth.new(nil, opts)
@@ -89,9 +93,11 @@
helper_class = OpensocialWap::OAuth::Helpers::BasicHelper.configure do
consumer_key 'sample_consumer_key'
consumer_secret 'sample_consumer_secret'
+ proxy_class OpensocialWap::OAuth::RequestProxy::OAuthRackRequestProxy
end
opts = {:helper_class => helper_class}
rack = OpensocialWap::Rack::OpensocialOauth.new(nil, opts)
+
result = rack.send :verify, request.env
result.should be_true
@@ -109,6 +115,7 @@
helper_class = OpensocialWap::OAuth::Helpers::BasicHelper.configure do
consumer_key 'sample_consumer_key'
consumer_secret 'foobar'
+ proxy_class OpensocialWap::OAuth::RequestProxy::OAuthRackRequestProxy
end
opts = {:helper_class => helper_class}
rack = OpensocialWap::Rack::OpensocialOauth.new(nil, opts)
View
1 spec/rails3/app_root/spec/.#reset_opensocial_wap_config.rb
View
1 spec/rails3/app_root/spec/reset_opensocial_wap_config.rb
@@ -1,6 +1,7 @@
def reset_opensocial_wap_config(config)
config.opensocial_wap.oauth = OpensocialWap::Config::OAuth.configure do
OpensocialWap::OAuth::Helpers::BasicHelper.configure do
+ proxy_class OpensocialWap::OAuth::RequestProxy::OAuthRackRequestProxy
consumer_key 'abcdef'
consumer_secret 'abcdefg12345'
api_endpoint 'http://api.example.com/'

0 comments on commit b778b96

Please sign in to comment.