Skip to content

Commit

Permalink
Start adding integration tests.
Browse files Browse the repository at this point in the history
Added Guard.
Removed unused deps.
  • Loading branch information
hzalaz committed Apr 15, 2015
1 parent fdb5c22 commit 3d74934
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--color
--format documentation
--fail-fast
--format Fuubar
--color
6 changes: 6 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
guard 'rspec', cmd: 'rspec --drb --format Fuubar --color' do
# run every updated spec file
watch(%r{^spec/.+_spec\.rb$})
# run the lib specs when a file in lib/ changes
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
end
24 changes: 19 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
#!/usr/bin/env rake
require "bundler/gem_tasks"
require 'rspec/core/rake_task'

desc "Run specs"
RSpec::Core::RakeTask.new
begin
require 'rspec/core/rake_task'

desc 'Run specs'
task :default => :spec
desc "Run Integration Tests"
RSpec::Core::RakeTask.new(:integration) do |t|
t.pattern = FileList["spec/integration/**/*#{ENV['PATTERN']}*_spec.rb"]
end


desc "Run Unit Tests"
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = FileList["spec/lib/auth0/**/*#{ENV['PATTERN']}*_spec.rb"]
end

task :default => :spec

task :all => [:spec, :integration]
rescue LoadError
#No RSpec
end
3 changes: 2 additions & 1 deletion auth0.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'httparty', '~> 0.13'

s.add_development_dependency 'rake'
s.add_development_dependency 'fuubar'
s.add_development_dependency 'guard-rspec'
s.add_development_dependency 'rspec', '~> 3.1.0', '>= 3.1.0'
s.add_development_dependency 'rack-test'
s.add_development_dependency 'simplecov'
s.add_development_dependency 'webmock'
s.add_development_dependency 'byebug'
s.add_development_dependency 'faker'
s.add_development_dependency 'yard'
Expand Down
4 changes: 4 additions & 0 deletions spec/integration/lib/auth0/auth0_client_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require "spec_helper"
describe Auth0Client do
it { expect { Auth0Client.new({}) }.to raise_error(SocketError) }
end
2 changes: 0 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
end
require 'rspec'
require 'rack/test'
require 'webmock/rspec'
require 'byebug'
require 'auth0'
Dir[("./lib/**/*.rb")].each { |f| require f }
Dir[("./spec/support/**/*.rb")].each { |f| require f }
RSpec.configure do |config|
config.include WebMock::API
config.include Rack::Test::Methods
# config.fail_fast = true
end

0 comments on commit 3d74934

Please sign in to comment.