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

Commit

Permalink
Merge pull request #7 from ChalkSchools/add_guard
Browse files Browse the repository at this point in the history
add guard, configure simplecov for ci
  • Loading branch information
golmansax committed Dec 31, 2014
2 parents 57cf28d + 57fc4ba commit e5d1d2a
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
sudo: false
language: ruby
rvm:
- 2.1.3
script:
- bundle exec travis lint --skip-completion-check
- bundle exec rspec
- bundle exec rubocop -D
14 changes: 8 additions & 6 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 'rake'
gem 'travis'
gem 'rubocop'
gem 'rspec'
gem 'coveralls', '~> 0.7.2'
gem 'guard-rspec', '~> 4.5.0'
gem 'guard-rubocop', '~> 1.2.0'
gem 'rake', '~> 10.4.2'
gem 'rspec', '~> 3.1.0'
gem 'rubocop', '~> 0.28.0'
gem 'simplecov', '~> 0.9.1'
gem 'travis', '~> 1.7.4'
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
7 changes: 7 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)

require 'rubocop/rake_task'
RuboCop::RakeTask.new

task default: [:spec, :rubocop]
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 e5d1d2a

Please sign in to comment.