Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2143 from ndbroadbent/travis_ci_template
Browse files Browse the repository at this point in the history
Added -t option for `bundle gem` to generate a .travis.yml file with the current Ruby version
  • Loading branch information
indirect committed Jan 26, 2013
2 parents cab01e6 + 898916c commit 00a416b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,9 @@ def gem(name)
template(File.join("newgem/test/minitest_helper.rb.tt"), File.join(target, "test/minitest_helper.rb"), opts)
template(File.join("newgem/test/test_newgem.rb.tt"), File.join(target, "test/test_#{namespaced_path}.rb"), opts)
end
if options[:test]
template(File.join("newgem/.travis.yml.tt"), File.join(target, ".travis.yml"), opts)
end
Bundler.ui.info "Initializating git repo in #{target}"
Dir.chdir(target) { `git init`; `git add .` }

Expand Down
3 changes: 3 additions & 0 deletions lib/bundler/templates/newgem/.travis.yml.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: ruby
rvm:
- <%= RUBY_VERSION %>
4 changes: 4 additions & 0 deletions spec/other/newgem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@
expect(bundled_app("test_gem/spec/spec_helper.rb")).to exist
expect(bundled_app("test_gem/test/minitest_helper.rb")).to_not exist
end

it "creates a .travis.yml file to test the library against the current Ruby version on Travis CI" do
expect(bundled_app("test_gem/.travis.yml").read).to match(%r(- #{RUBY_VERSION}))
end
end

context "--edit option" do
Expand Down

0 comments on commit 00a416b

Please sign in to comment.