Skip to content

Commit

Permalink
Modernize rspec integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jul 6, 2017
1 parent 2c60454 commit c2c7010
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
/pkg/
/spec/reports/
/tmp/
.rspec_status
.tags
3 changes: 2 additions & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--format documentation
--color
--backtrace
--warnings
--require spec_helper
9 changes: 0 additions & 9 deletions .simplecov

This file was deleted.

13 changes: 5 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec) do |task|
begin
require('simplecov/version')
task.rspec_opts = %w{--require simplecov} if ENV['COVERAGE']
rescue LoadError
end
end
# Load all rake tasks:
import(*Dir.glob('tasks/**/*.rake'))

task :default => :spec
RSpec::Core::RakeTask.new(:test)

task :default => :test
2 changes: 1 addition & 1 deletion samovar.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ Gem::Specification.new do |spec|

spec.add_development_dependency "bundler", "~> 1.11"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rspec", "~> 3.6"
end
29 changes: 29 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

if ENV['COVERAGE'] || ENV['TRAVIS']
begin
require 'simplecov'

SimpleCov.start do
add_filter "/spec/"
end

if ENV['TRAVIS']
require 'coveralls'
Coveralls.wear!
end
rescue LoadError
warn "Could not load simplecov: #{$!}"
end
end

require "bundler/setup"
require "samovar"

RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"

config.expect_with :rspec do |c|
c.syntax = :expect
end
end

0 comments on commit c2c7010

Please sign in to comment.