spec/git_trend/scraper_spec.rb in git-trend-0.0.1 vs spec/git_trend/scraper_spec.rb in git-trend-0.0.2
- old
+ new
@@ -17,11 +17,11 @@
describe '#get' do
after do
# reset initialize
# warning measure: already initialized constant
- [3, 40, 6, 5].each_with_index { |n, i| Rendering::DEFAULT_RULED_LINE_SIZE[i] = n }
+ [3, 40, 10, 6, 5].each_with_index { |n, i| Rendering::DEFAULT_RULED_LINE_SIZE[i] = n }
end
context 'when a network error occurred' do
before do
stub_request(:get, Scraper::BASE_URL).
@@ -38,37 +38,37 @@
end
let(:language) {nil}
it 'display daily ranking' do
res = <<-'EOS'.unindent
- |No. Name Star Fork
- |--- -------------------------------------------------- ------ -----
- | 1 prat0318/json_resume 264 15
- | 2 andlabs/ui 185 8
- | 3 jessepollak/card 174 9
- | 4 fullstackio/FlappySwift 148 44
- | 5 grant/swift-cheat-sheet 153 13
- | 6 Flolagale/mailin 155 3
- | 7 numbbbbb/the-swift-programming-language-in-chinese 120 31
- | 8 hippyvm/hippyvm 113 1
- | 9 neovim/neovim 83 8
- | 10 hiphopapp/hiphop 77 8
- | 11 interagent/http-api-design 78 4
- | 12 austinzheng/swift-2048 69 16
- | 13 mdznr/What-s-New 72 2
- | 14 daneden/animate.css 65 6
- | 15 davidmerfield/randomColor 66 3
- | 16 dawn/dawn 62 2
- | 17 greatfire/wiki 54 9
- | 18 swift-jp/swift-guide 45 9
- | 19 addyosmani/psi 49 0
- | 20 mtford90/silk 47 0
- | 21 agaue/agaue 47 0
- | 22 mentionapp/mntpulltoreact 46 1
- | 23 mikepenz/AboutLibraries 45 0
- | 24 PistonDevelopers/piston-workspace 45 0
- | 25 maxpow4h/swiftz 43 1
+ |No. Name Lang Star Fork
+ |--- -------------------------------------------------- ------------ ------ -----
+ | 1 prat0318/json_resume Ruby 264 15
+ | 2 andlabs/ui Go 185 8
+ | 3 jessepollak/card CSS 174 9
+ | 4 fullstackio/FlappySwift Swift 148 44
+ | 5 grant/swift-cheat-sheet 153 13
+ | 6 Flolagale/mailin Python 155 3
+ | 7 numbbbbb/the-swift-programming-language-in-chinese JavaScript 120 31
+ | 8 hippyvm/hippyvm PHP 113 1
+ | 9 neovim/neovim C 83 8
+ | 10 hiphopapp/hiphop CoffeeScript 77 8
+ | 11 interagent/http-api-design 78 4
+ | 12 austinzheng/swift-2048 Swift 69 16
+ | 13 mdznr/What-s-New Objective-C 72 2
+ | 14 daneden/animate.css CSS 65 6
+ | 15 davidmerfield/randomColor JavaScript 66 3
+ | 16 dawn/dawn Ruby 62 2
+ | 17 greatfire/wiki 54 9
+ | 18 swift-jp/swift-guide CSS 45 9
+ | 19 addyosmani/psi JavaScript 49 0
+ | 20 mtford90/silk Python 47 0
+ | 21 agaue/agaue Go 47 0
+ | 22 mentionapp/mntpulltoreact Objective-C 46 1
+ | 23 mikepenz/AboutLibraries Java 45 0
+ | 24 PistonDevelopers/piston-workspace Shell 45 0
+ | 25 maxpow4h/swiftz Swift 43 1
EOS
expect { @scraper.get(language) }.to output(res).to_stdout
end
end
@@ -80,37 +80,37 @@
end
let(:language) {'ruby'}
it 'display daily ranking by language' do
res = <<-'EOS'.unindent
- |No. Name Star Fork
- |--- ---------------------------------------- ------ -----
- | 1 prat0318/json_resume 412 27
- | 2 dawn/dawn 57 2
- | 3 Homebrew/homebrew 15 7
- | 4 etsy/nagios-herald 18 0
- | 5 jekyll/jekyll 14 4
- | 6 opf/openproject 11 0
- | 7 caskroom/homebrew-cask 9 3
- | 8 rails/rails 6 7
- | 9 interagent/prmd 9 0
- | 10 mitchellh/vagrant 8 2
- | 11 discourse/discourse 7 3
- | 12 CanCanCommunity/cancancan 7 1
- | 13 venmo/synx 7 0
- | 14 laravel/homestead 6 2
- | 15 alexreisner/geocoder 6 0
- | 16 visionmedia/commander 5 0
- | 17 CocoaPods/Specs 0 3
- | 18 gitlabhq/gitlabhq 0 2
- | 19 puppetlabs/puppetlabs-apache 0 2
- | 20 gitlabhq/gitlab-recipes 0 2
- | 21 Mixd/wp-deploy 0 1
- | 22 svenfuchs/rails-i18n 0 1
- | 23 Homebrew/homebrew-php 0 1
- | 24 sferik/twitter 0 1
- | 25 rightscale/rightscale_cookbooks 0 1
+ |No. Name Lang Star Fork
+ |--- ---------------------------------------- ---------- ------ -----
+ | 1 prat0318/json_resume Ruby 412 27
+ | 2 dawn/dawn Ruby 57 2
+ | 3 Homebrew/homebrew Ruby 15 7
+ | 4 etsy/nagios-herald Ruby 18 0
+ | 5 jekyll/jekyll Ruby 14 4
+ | 6 opf/openproject Ruby 11 0
+ | 7 caskroom/homebrew-cask Ruby 9 3
+ | 8 rails/rails Ruby 6 7
+ | 9 interagent/prmd Ruby 9 0
+ | 10 mitchellh/vagrant Ruby 8 2
+ | 11 discourse/discourse Ruby 7 3
+ | 12 CanCanCommunity/cancancan Ruby 7 1
+ | 13 venmo/synx Ruby 7 0
+ | 14 laravel/homestead Shell 6 2
+ | 15 alexreisner/geocoder Ruby 6 0
+ | 16 visionmedia/commander Ruby 5 0
+ | 17 CocoaPods/Specs Ruby 0 3
+ | 18 gitlabhq/gitlabhq Ruby 0 2
+ | 19 puppetlabs/puppetlabs-apache Ruby 0 2
+ | 20 gitlabhq/gitlab-recipes Ruby 0 2
+ | 21 Mixd/wp-deploy Ruby 0 1
+ | 22 svenfuchs/rails-i18n Ruby 0 1
+ | 23 Homebrew/homebrew-php Ruby 0 1
+ | 24 sferik/twitter Ruby 0 1
+ | 25 rightscale/rightscale_cookbooks Ruby 0 1
EOS
expect { @scraper.get(language) }.to output(res).to_stdout
end
end
@@ -121,36 +121,36 @@
end
let(:language) {'objective-c++'}
it 'display daily ranking by language' do
res = <<-'EOS'.unindent
- |No. Name Star Fork
- |--- ---------------------------------------- ------ -----
- | 1 facebook/pop 0 0
- | 2 johnno1962/Xtrace 0 0
- | 3 pivotal/cedar 0 0
- | 4 wetube/bitcloud 0 0
- | 5 jerols/PopTut 0 0
- | 6 otaviocc/OCBorghettiView 0 0
- | 7 droolsjbpm/optaplanner 0 0
- | 8 otaviocc/NHCalendarActivity 0 0
- | 9 callmeed/pop-playground 0 0
- | 10 jxd001/POPdemo 0 0
- | 11 couchdeveloper/RXPromise 0 0
- | 12 johnno1962/XprobePlugin 0 0
- | 13 openpeer/opios 0 0
- | 14 pivotal/PivotalCoreKit 0 0
- | 15 rbaumbach/Swizzlean 0 0
- | 16 andreacremaschi/ShapeKit 0 0
- | 17 Smartype/iOS_VPNPlugIn 0 0
- | 18 humblehacker/AutoLayoutDSL 0 0
- | 19 hoddez/FFTAccelerate 0 0
- | 20 armadillu/ofxPanZoom 0 0
- | 21 dodikk/CsvToSqlite 0 0
- | 22 hbang/TypeStatus 0 0
- | 23 trentbrooks/ofxCoreMotion 0 0
- | 24 Yonsm/CeleWare 0 0
- | 25 ccrma/miniAudicle 0 0
+ |No. Name Lang Star Fork
+ |--- ---------------------------------------- ------------- ------ -----
+ | 1 facebook/pop Objective-C++ 0 0
+ | 2 johnno1962/Xtrace Objective-C++ 0 0
+ | 3 pivotal/cedar Objective-C++ 0 0
+ | 4 wetube/bitcloud Objective-C++ 0 0
+ | 5 jerols/PopTut Objective-C++ 0 0
+ | 6 otaviocc/OCBorghettiView Objective-C++ 0 0
+ | 7 droolsjbpm/optaplanner Objective-C++ 0 0
+ | 8 otaviocc/NHCalendarActivity Objective-C++ 0 0
+ | 9 callmeed/pop-playground Objective-C++ 0 0
+ | 10 jxd001/POPdemo Objective-C++ 0 0
+ | 11 couchdeveloper/RXPromise Objective-C++ 0 0
+ | 12 johnno1962/XprobePlugin Objective-C++ 0 0
+ | 13 openpeer/opios Objective-C++ 0 0
+ | 14 pivotal/PivotalCoreKit Objective-C++ 0 0
+ | 15 rbaumbach/Swizzlean Objective-C++ 0 0
+ | 16 andreacremaschi/ShapeKit Objective-C++ 0 0
+ | 17 Smartype/iOS_VPNPlugIn Objective-C++ 0 0
+ | 18 humblehacker/AutoLayoutDSL Objective-C++ 0 0
+ | 19 hoddez/FFTAccelerate Objective-C++ 0 0
+ | 20 armadillu/ofxPanZoom Objective-C++ 0 0
+ | 21 dodikk/CsvToSqlite Objective-C++ 0 0
+ | 22 hbang/TypeStatus Objective-C++ 0 0
+ | 23 trentbrooks/ofxCoreMotion Objective-C++ 0 0
+ | 24 Yonsm/CeleWare Objective-C++ 0 0
+ | 25 ccrma/miniAudicle Objective-C++ 0 0
EOS
expect { @scraper.get(language) }.to output(res).to_stdout
end
end
end