popularity 0.1.1 → 0.2.1

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.
@@ -1,34 +0,0 @@
1
- require 'simplecov'
2
-
3
- module SimpleCov::Configuration
4
- def clean_filters
5
- @filters = []
6
- end
7
- end
8
-
9
- SimpleCov.configure do
10
- clean_filters
11
- load_adapter 'test_frameworks'
12
- end
13
-
14
- ENV["COVERAGE"] && SimpleCov.start do
15
- add_filter "/.rvm/"
16
- end
17
- require 'rubygems'
18
- require 'bundler'
19
- begin
20
- Bundler.setup(:default, :development)
21
- rescue Bundler::BundlerError => e
22
- $stderr.puts e.message
23
- $stderr.puts "Run `bundle install` to install missing gems"
24
- exit e.status_code
25
- end
26
- require 'minitest/autorun'
27
- require 'shoulda'
28
- require 'webmock'
29
- require 'vcr'
30
-
31
-
32
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
33
- $LOAD_PATH.unshift(File.dirname(__FILE__))
34
- require 'popularity'
@@ -1,27 +0,0 @@
1
- require 'helper'
2
-
3
- VCR.configure do |config|
4
- config.cassette_library_dir = "test/fixtures/vcr_cassettes"
5
- config.hook_into :webmock
6
- end
7
-
8
- class NonSpecificUrlTest < Minitest::Test
9
- def setup
10
-
11
- end
12
-
13
- def test_total
14
- VCR.use_cassette("google") do
15
- p = Popularity.search('http://google.com')
16
- assert_match 23405566, p.total
17
- end
18
- end
19
-
20
- def test_search_info
21
- VCR.use_cassette("google") do
22
- p = Popularity.search('http://google.com')
23
- assert_match 23405566, p.total
24
- end
25
- end
26
- end
27
-
@@ -1,28 +0,0 @@
1
- require 'helper'
2
-
3
- class FacebookTest < Minitest::Test
4
- def test_total
5
- VCR.use_cassette("facebook") do
6
- @p = Popularity::Facebook.new('http://google.com')
7
-
8
- assert_equal (@p.shares + @p.comments), @p.total
9
- end
10
- end
11
-
12
- def test_comments
13
- VCR.use_cassette("facebook") do
14
- @p = Popularity::Facebook.new('http://google.com')
15
-
16
- assert_equal 10121, @p.comments
17
- end
18
- end
19
-
20
- def test_shares
21
- VCR.use_cassette("facebook") do
22
- @p = Popularity::Facebook.new('http://google.com')
23
-
24
- assert_equal 12081903, @p.shares
25
- end
26
- end
27
- end
28
-