Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis CI added to Continuous Testing recipe #183

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions recipes/gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@
gem 'rb-fsevent', '>= 0.9.3', :group => :development, :require => false
gem 'rb-fchange', '>= 0.0.6', :group => :development, :require => false
end
if prefer :continuous_testing, 'travis'
gem 'rake', '>= 0.9.2', :group => :development
end
if prefer :continuous_testing, 'guard-travis'
gem 'guard-bundler', '>= 1.0.0', :group => :development
gem 'guard-cucumber', '>= 1.4.0', :group => :development if prefer :integration, 'cucumber'
gem 'guard-rails', '>= 0.4.0', :group => :development
gem 'guard-rspec', '>= 2.5.2', :group => :development if prefer :unit_test, 'rspec'
gem 'rb-inotify', '>= 0.9.0', :group => :development, :require => false
gem 'rb-fsevent', '>= 0.9.3', :group => :development, :require => false
gem 'rb-fchange', '>= 0.0.6', :group => :development, :require => false
gem 'rake', '>= 0.9.2', :group => :test
end
gem 'factory_girl_rails', '>= 4.2.0', :group => [:development, :test] if prefer :fixtures, 'factory_girl'
gem 'fabrication', '>= 2.3.0', :group => [:development, :test] if prefer :fixtures, 'fabrication'
gem 'machinist', '>= 2.0', :group => :test if prefer :fixtures, 'machinist'
Expand Down
2 changes: 1 addition & 1 deletion recipes/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
prefs[:unit_test] = multiple_choice "Unit testing?", [["Test::Unit", "test_unit"], ["RSpec", "rspec"], ["MiniTest", "minitest"]] unless prefs.has_key? :unit_test
prefs[:integration] = multiple_choice "Integration testing?", [["None", "none"], ["RSpec with Capybara", "rspec-capybara"],
["Cucumber with Capybara", "cucumber"], ["Turnip with Capybara", "turnip"], ["MiniTest with Capybara", "minitest-capybara"]] unless prefs.has_key? :integration
prefs[:continuous_testing] = multiple_choice "Continuous testing?", [["None", "none"], ["Guard", "guard"]] unless prefs.has_key? :continuous_testing
prefs[:continuous_testing] = multiple_choice "Continuous testing?", [["None", "none"], ["Guard", "guard"], ["Travis CI", "travis"], ["Guard with Travis CI", "guard-travis"]] unless prefs.has_key? :continuous_testing
prefs[:fixtures] = multiple_choice "Fixture replacement?", [["None","none"], ["Factory Girl","factory_girl"], ["Machinist","machinist"], ["Fabrication","fabrication"]] unless prefs.has_key? :fixtures
end

Expand Down
21 changes: 20 additions & 1 deletion recipes/testing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,30 @@
say_wizard "generating blueprints file for 'machinist'"
generate 'machinist:install'
end
### GUARD
## GUARD AND TRAVIS CI
travis_yml = <<-TRAVIS
# For more information on getting started with Travis CI
# http://about.travis-ci.org/docs/user/getting-started/
# Customizing your build environment and configuration
# http://about.travis-ci.org/docs/user/languages/ruby/
language: ruby
rvm:
- #{RUBY_VERSION}

TRAVIS
if prefer :continuous_testing, 'guard'
say_wizard "recipe initializing Guard"
run 'bundle exec guard init'
end
if prefer :continuous_testing, 'travis'
say_wizard "generating .travis.yml"
create_file '.travis.yml', travis_yml
end
if prefer :continuous_testing, 'guard-travis'
say_wizard "recipe initializing Guard and generating .travis.yml"
run 'bundle exec guard init'
create_file '.travis.yml', travis_yml
end
### GIT ###
git :add => '-A' if prefer :git, true
git :commit => '-qm "rails_apps_composer: testing framework"' if prefer :git, true
Expand Down