Skip to content

Commit

Permalink
[Kicker] Add kicker
Browse files Browse the repository at this point in the history
  • Loading branch information
segiddins committed May 23, 2014
1 parent ff0b32c commit dbda07e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .kick
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
recipe :ruby

Kicker::Recipes::Ruby.runner_bin = 'bacon --quiet'

process do |files|
specs = files.take_and_map do |file|
if file =~ %r{lib/(.+?)\.rb$}
s = Dir.glob("spec/**/#{File.basename(file, '.rb')}_spec.rb")
s.uniq unless s.empty?
end
end
Kicker::Recipes::Ruby.run_tests(specs)
end

# Have written this so many times, probably should make a recipe out of it.
process do |files|
files.each do |file|
case file
when 'Gemfile'
files.delete(file)
execute 'bundle install'
end
end
end

recipe :ignore
ignore(/.*\/?tags/)
ignore(/.*\/?\.git/)

1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ group :development do
gem 'mocha-on-bacon'
gem 'mocha', '~> 0.11.4'
gem 'prettybacon'
gem 'kicker'
end

5 changes: 5 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ task :specs do
sh "bundle exec bacon #{specs('**')}"
end

desc 'Automatically run specs for updated files'
task :kick do
exec 'bundle exec kicker -c'
end

task :default => :specs

0 comments on commit dbda07e

Please sign in to comment.