Skip to content

Commit

Permalink
Add Coveralls. sleep(1) to avoid 429 Too Many Requests
Browse files Browse the repository at this point in the history
  • Loading branch information
tk committed Aug 21, 2015
1 parent 945cf51 commit 45d6e33
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 46 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repo_token: D1ZrNoAoVUgrr8B1KvO8ky8jUpFftVJfH
45 changes: 33 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,40 @@ PATH
remote: .
specs:
togglv8 (0.2.0)
faraday (~> 0.9)
logger (~> 1.2)
oj (~> 2.12)
faraday
logger
oj

GEM
remote: https://rubygems.org/
specs:
awesome_print (1.6.1)
codeclimate-test-reporter (0.4.7)
simplecov (>= 0.7.1, < 1.0.0)
coveralls (0.8.2)
json (~> 1.8)
rest-client (>= 1.6.8, < 2)
simplecov (~> 0.10.0)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
diff-lcs (1.2.5)
docile (1.1.5)
domain_name (0.5.24)
unf (>= 0.0.5, < 1.0.0)
faraday (0.9.1)
multipart-post (>= 1.2, < 3)
fivemat (1.3.1)
http-cookie (1.0.2)
domain_name (~> 0.5)
json (1.8.3)
logger (1.2.8)
mime-types (2.6.1)
multipart-post (2.0.0)
netrc (0.10.3)
oj (2.12.12)
rake (10.4.2)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
rspec (3.3.0)
rspec-core (~> 3.3.0)
rspec-expectations (~> 3.3.0)
Expand All @@ -40,18 +54,25 @@ GEM
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
term-ansicolor (1.3.2)
tins (~> 1.0)
thor (0.19.1)
tins (1.6.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.1)

PLATFORMS
ruby

DEPENDENCIES
awesome_print (~> 1.6)
bundler (~> 1.7)
codeclimate-test-reporter
fivemat (~> 1.3)
rake (~> 10.4)
rspec (~> 3.3)
simplecov (~> 0.10)
awesome_print
bundler
coveralls
fivemat
rake
rspec
simplecov
togglv8!

BUNDLED WITH
Expand Down
10 changes: 5 additions & 5 deletions spec/lib/togglv8/clients_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe 'Clients' do
before :all do
sleep(0.5)
sleep(1)
@toggl = TogglV8::API.new(Testing::API_TOKEN)
@workspaces = @toggl.workspaces
@workspace_id = @workspaces.first['id']
Expand All @@ -18,7 +18,7 @@

context 'new client' do
before :all do
sleep(0.5)
sleep(1)
@client = @toggl.create_client({ 'name' => 'new client', 'wid' => @workspace_id })
client_ids = @toggl.my_clients.map { |c| c['id'] }
expect(client_ids).to eq [ @client['id'] ]
Expand All @@ -42,7 +42,7 @@

context 'multiple clients' do
before :all do
sleep(0.5)
sleep(1)
@client2 = @toggl.create_client({ 'name' => 'new client 2', 'wid' => @workspace_id })
end

Expand Down Expand Up @@ -85,7 +85,7 @@

context 'new client projects' do
before :all do
sleep(0.5)
sleep(1)
@project = @toggl.create_project({ 'name' => 'project', 'wid' => @workspace_id, 'cid' => @client['id'] })
end

Expand Down Expand Up @@ -114,7 +114,7 @@

context 'updated client' do
before :each do
sleep(0.5)
sleep(1)
@client = @toggl.create_client({ 'name' => 'client to update', 'wid' => @workspace_id })
end

Expand Down
2 changes: 1 addition & 1 deletion spec/lib/togglv8/dashboard_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe 'Dashboard' do
before :all do
sleep(0.5)
sleep(1)
@toggl = TogglV8::API.new(Testing::API_TOKEN)
@workspaces = @toggl.workspaces
@workspace_id = @workspaces.first['id']
Expand Down
6 changes: 3 additions & 3 deletions spec/lib/togglv8/projects_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe 'Projects' do
before :all do
sleep(0.5)
sleep(1)
@toggl = TogglV8::API.new(Testing::API_TOKEN)
@workspaces = @toggl.workspaces
@workspace_id = @workspaces.first['id']
Expand All @@ -13,7 +13,7 @@

context 'new project' do
before :all do
sleep(0.5)
sleep(1)
@project = @toggl.create_project({ 'name' => 'new project', 'wid' => @workspace_id })
project_ids = @toggl.my_projects.map { |p| p['id'] }
expect(project_ids).to eq [ @project['id'] ]
Expand Down Expand Up @@ -52,7 +52,7 @@

context 'updated project' do
before :each do
sleep(0.5)
sleep(1)
@project = @toggl.create_project({ 'name' => 'project to update', 'wid' => @workspace_id })
end

Expand Down
6 changes: 3 additions & 3 deletions spec/lib/togglv8/tags_spec.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
describe 'Tags' do
before :all do
sleep(0.5)
sleep(1)
@toggl = TogglV8::API.new(Testing::API_TOKEN)
@workspaces = @toggl.workspaces
@workspace_id = @workspaces.first['id']
end

context 'new tag' do
before :all do
sleep(0.5)
sleep(1)
@tag = @toggl.create_tag({ 'name' => 'new tag', 'wid' => @workspace_id })
tag_ids = @toggl.my_tags.map { |t| t['id'] }
expect(tag_ids).to eq [ @tag['id'] ]
Expand All @@ -30,7 +30,7 @@

context 'updated tag' do
before :each do
sleep(0.5)
sleep(1)
@tag = @toggl.create_tag({ 'name' => 'tag to update', 'wid' => @workspace_id })
end

Expand Down
6 changes: 3 additions & 3 deletions spec/lib/togglv8/tasks_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe 'Tasks', :pro_account do
before :all do
sleep(0.5)
sleep(1)
@toggl = TogglV8::API.new(Testing::API_TOKEN)
@workspaces = @toggl.workspaces
@workspace_id = @workspaces.first['id']
Expand All @@ -13,7 +13,7 @@

context 'new task' do
before :all do
sleep(0.5)
sleep(1)
@task = @toggl.create_task({ name: 'new task', pid: @project['id'] })
task_ids = @toggl.get_project_tasks(@project['id']).map { |t| t['id'] }
expect(task_ids).to eq [ @task['id'] ]
Expand Down Expand Up @@ -60,7 +60,7 @@

context 'multiple tasks' do
before :each do
sleep(0.5)
sleep(1)
@task1 = @toggl.create_task({ name: 'task1', pid: @project['id'] })
@task2 = @toggl.create_task({ name: 'task2', pid: @project['id'] })
@task3 = @toggl.create_task({ name: 'task3', pid: @project['id'] })
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/togglv8/time_entries_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

describe 'Time Entries' do
before :all do
sleep(0.5)
sleep(1)
@toggl = TogglV8::API.new(Testing::API_TOKEN)
@workspaces = @toggl.workspaces
@workspace_id = @workspaces.first['id']
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/togglv8/users_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe 'Users' do
before :all do
sleep(0.5)
sleep(1)
@toggl = TogglV8::API.new(Testing::API_TOKEN)
@user = @toggl.me(all=true)
end
Expand Down
32 changes: 17 additions & 15 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
require "codeclimate-test-reporter"
CodeClimate::TestReporter.start
# require "codeclimate-test-reporter"
# CodeClimate::TestReporter.start

# require 'simplecov'
require 'coveralls'
Coveralls.wear!

# require 'simplecov'
# SimpleCov.start do
# require 'simplecov-badge'
# add_group 'lib', 'lib/'
# add_filter '/doc/'
# add_filter '/spec/'
# add_filter '/pkg/'
# configure any options you want for SimpleCov::Formatter::BadgeFormatter
# SimpleCov::Formatter::BadgeFormatter.generate_groups = true
# SimpleCov::Formatter::BadgeFormatter.timestamp = true
# SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
# SimpleCov::Formatter::HTMLFormatter,
# SimpleCov::Formatter::BadgeFormatter,
# ]
# require 'simplecov-badge'
# add_group 'lib', 'lib/'
# add_filter '/doc/'
# add_filter '/spec/'
# add_filter '/pkg/'
# # configure any options you want for SimpleCov::Formatter::BadgeFormatter
# SimpleCov::Formatter::BadgeFormatter.generate_groups = true
# SimpleCov::Formatter::BadgeFormatter.timestamp = true
# SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
# SimpleCov::Formatter::HTMLFormatter,
# SimpleCov::Formatter::BadgeFormatter,
# ]
# end
# NOTE: SimpleCov.start must be issued before any application code is required!
# -----------------------------------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions togglv8.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "awesome_print"
spec.add_development_dependency "fivemat"
spec.add_development_dependency "simplecov"
spec.add_development_dependency "simplecov-badge"
spec.add_development_dependency "codeclimate-test-reporter"
# spec.add_development_dependency "simplecov-badge"
# spec.add_development_dependency "codeclimate-test-reporter"
spec.add_development_dependency "coveralls"

spec.add_dependency "logger"
spec.add_dependency "faraday"
Expand Down

0 comments on commit 45d6e33

Please sign in to comment.