Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactor tests

  • Loading branch information...
commit dbfc62c3b3eab2ba6fa34f8ea43668291174cf39 1 parent 43180e7
@aprimadi aprimadi authored
View
2  Gemfile
@@ -2,5 +2,7 @@ source 'https://rubygems.org'
gemspec
+gem 'jeweler2'
gem 'rspec', '~> 2.11.0'
+gem 'rake'
gem 'activesupport'
View
6 Gemfile.lock
@@ -14,10 +14,14 @@ GEM
i18n (~> 0.6)
multi_json (~> 1.0)
diff-lcs (1.1.3)
+ git (1.2.5)
hashie (2.0.2)
i18n (0.6.4)
+ jeweler2 (2.0.9)
+ git (>= 1.2.5)
mime-types (1.21)
multi_json (1.6.1)
+ rake (10.0.3)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (2.11.0)
@@ -34,5 +38,7 @@ PLATFORMS
DEPENDENCIES
activesupport
+ jeweler2
mini_fb!
+ rake
rspec (~> 2.11.0)
View
5 Rakefile
@@ -16,3 +16,8 @@ begin
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install jeweler2"
end
+
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new do |t|
+ t.rspec_opts = ["--color", '--format doc']
+end
View
11 test/test_mini_fb.rb → spec/mini_fb_spec.rb
@@ -4,21 +4,17 @@
require 'active_support/core_ext'
require_relative '../lib/mini_fb'
-describe "Some Feature" do
+describe MiniFB do
before :all do
@is_setup = true
file_path = File.expand_path("../mini_fb_tests.yml", File.dirname(__FILE__))
@config = File.open(file_path) { |yf| YAML::load(yf) }
- puts "@config=" + @config.inspect
- MiniFB.log_level = :debug
+ MiniFB.log_level = :warn
- @oauth_url = MiniFB.oauth_url(@config['fb_app_id'], # your Facebook App ID (NOT API_KEY)
+ @oauth_url = MiniFB.oauth_url(@config['fb_app_id'],
"http://localhost:3000", # redirect url
:scope=>MiniFB.scopes.join(","))
- puts "If you need an access token, go here in your browser:"
- puts "#{@oauth_url}"
- puts "Then grab the 'code' parameter in the redirect url and add it to mini_fb_tests.yml."
end
@@ -33,7 +29,6 @@
it 'test_authenticate_as_app' do
res = MiniFB.authenticate_as_app(@config["fb_api_key"], @config["fb_secret"])
- puts 'res=' + res.inspect
res.should include("access_token")
res["access_token"].should match(/^#{@config['fb_app_id']}/)#starts_with?(@config["fb_app_id"].to_s)
end
Please sign in to comment.
Something went wrong with that request. Please try again.