Skip to content
This repository has been archived by the owner on Mar 28, 2018. It is now read-only.

Commit

Permalink
add guard, configure simplecov for ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mockdeep committed Dec 30, 2014
1 parent 57cf28d commit bea3059
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 8 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ rvm:
script:
- bundle exec travis lint --skip-completion-check
- bundle exec rspec
- bundle exec rubocop -D
8 changes: 5 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ source 'https://rubygems.org'
gemspec

group :development, :test do
gem 'simplecov'
gem 'coveralls'
gem 'guard-rspec'
gem 'guard-rubocop'
gem 'rake'
gem 'travis'
gem 'rubocop'
gem 'rspec'
gem 'rubocop'
gem 'simplecov'
gem 'travis'
end
22 changes: 22 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
group :everything, halt_on_fail: true do
guard :rspec, cmd: 'bundle exec rspec' do
require 'guard/rspec/dsl'
dsl = Guard::RSpec::Dsl.new(self)

rspec = dsl.rspec
watch(rspec.spec_helper) { rspec.spec_dir }
watch(rspec.spec_support) { rspec.spec_dir }
watch(rspec.spec_files)

# Ruby files
ruby = dsl.ruby
dsl.watch_spec_files_for(ruby.lib_files)
end

guard :rubocop, cli: %w(-D) do
watch(/.+\.rb$/)
watch(/Guardfile/)
watch(/Rakefile/)
watch(/(?:.+\/)?\.rubocop\.yml$/) { |m| File.dirname(m[0]) }
end
end
12 changes: 7 additions & 5 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
require 'simplecov'
require 'coveralls'
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]
if ENV['CI']
require 'coveralls'
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]
end
SimpleCov.start { add_filter '/spec/' }

require_relative '../lib/stink_bomb'
Expand Down

0 comments on commit bea3059

Please sign in to comment.