Permalink
Browse files

add specs for FBGraph::Client

  • Loading branch information...
1 parent 0de9420 commit 53fde0f8c055f0fc9c2523c9da91b3dc2c0d33ed @nsanta nsanta committed May 11, 2010
View
0 README
No changes.
View
File renamed without changes.
View
@@ -0,0 +1,33 @@
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{fbgraph}
+ s.version = "0.0.4"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Nicolas Santa"]
+ s.date = %q{2010-05-11}
+ s.description = %q{A Gem for Facebook Open Graph API}
+ s.email = %q{nicolas55ar@gmail.com}
+ s.extra_rdoc_files = ["README", "lib/fbgraph.rb", "lib/fbgraph/authorization.rb", "lib/fbgraph/base.rb", "lib/fbgraph/client.rb", "lib/fbgraph/search.rb", "lib/fbgraph/selection.rb"]
+ s.files = ["README", "Rakefile", "lib/fbgraph.rb", "lib/fbgraph/authorization.rb", "lib/fbgraph/base.rb", "lib/fbgraph/client.rb", "lib/fbgraph/search.rb", "lib/fbgraph/selection.rb", "specs/lib/fbauth/authorization_spec.rb", "specs/lib/fbauth/base_spec.rb", "specs/lib/fbauth/search_spec.rb", "Manifest", "fbgraph.gemspec"]
+ s.homepage = %q{http://github.com/nsanta/fbgraph}
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Fbgraph", "--main", "README"]
+ s.require_paths = ["lib"]
+ s.rubyforge_project = %q{fbgraph}
+ s.rubygems_version = %q{1.3.6}
+ s.summary = %q{A Gem for Facebook Open Graph API}
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_development_dependency(%q<oauth2>, [">= 0"])
+ else
+ s.add_dependency(%q<oauth2>, [">= 0"])
+ end
+ else
+ s.add_dependency(%q<oauth2>, [">= 0"])
+ end
+end
View
@@ -6,6 +6,4 @@
require 'fbgraph/authorization'
require 'fbgraph/selection'
require 'fbgraph/search'
-require 'fbgraph/realtime'
-
-
+#require 'fbgraph/realtime'
View
@@ -26,9 +26,9 @@ def search
FBGraph::Search.new(self)
end
- def realtime
- FBGraph::Realtime.new(self)
- end
+# def realtime
+# FBGraph::Realtime.new(self)
+# end
def oauth_client
View
Binary file not shown.
@@ -6,6 +6,4 @@
require 'fbgraph/authorization'
require 'fbgraph/selection'
require 'fbgraph/search'
-require 'fbgraph/realtime'
-
-
+#require 'fbgraph/realtime'
@@ -26,9 +26,9 @@ def search
FBGraph::Search.new(self)
end
- def realtime
- FBGraph::Realtime.new(self)
- end
+# def realtime
+# FBGraph::Realtime.new(self)
+# end
def oauth_client
@@ -0,0 +1,80 @@
+require File.join(File.dirname(__FILE__),"../../../lib/fbgraph")
+
+describe FBGraph do
+ describe FBGraph::Client do
+ describe "initialization" do
+ before :each do
+ @client_id = 'client_id'
+ @secret_id = 'secret_id'
+ end
+ describe 'default' do
+
+ before :each do
+ @client = FBGraph::Client.new(:client_id => @client_id,
+ :secret_id => @secret_id)
+ end
+
+ it 'should set the client_id' do
+ @client.client_id.should == @client_id
+ end
+ it 'should set the secret_id' do
+ @client.secret_id.should == @secret_id
+ end
+ it 'should set the facebook_uri ' do
+ @client.facebook_uri.should == "https://graph.facebook.com"
+ end
+ end
+
+ describe 'when token is present' do
+ before :each do
+ @token = 'token'
+ @client = FBGraph::Client.new(:client_id => @client_id,
+ :secret_id => @secret_id,
+ :token => @token)
+ end
+
+ it 'should set the access_token' do
+ @client.access_token.should == @token
+ end
+ it 'should set the consumer client' do
+ @client.consumer.class.should == OAuth2::AccessToken
+ end
+ end
+ end
+
+
+ describe "instance methods" do
+ before :each do
+ @client_id = 'client_id'
+ @secret_id = 'secret_id'
+ @client = FBGraph::Client.new(:client_id => @client_id,
+ :secret_id => @secret_id)
+ end
+ describe '.authorization' do
+ it 'should return a FBGraph::Authorization object' do
+ @client.authorization.class.should == FBGraph::Authorization
+ end
+ end
+
+ describe '.selection' do
+ it 'should return a FBGraph::Selection object' do
+ @client.selection.class.should == FBGraph::Selection
+ end
+ end
+
+ describe '.search' do
+ it 'should return a FBGraph::Search object' do
+ @client.search.class.should == FBGraph::Search
+ end
+ end
+
+ describe '.realtime'
+
+ describe '.oauth_client' do
+ it 'should return a OAuth2::Client object' do
+ @client.oauth_client.class.should == OAuth2::Client
+ end
+ end
+ end
+ end
+end
No changes.
No changes.
View
No changes.

0 comments on commit 53fde0f

Please sign in to comment.