Skip to content

Commit

Permalink
Announce gem --version before the build
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Jan 24, 2012
1 parent 5c4e5a7 commit 6df22f2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
20 changes: 14 additions & 6 deletions features/support/step_definitions.rb
Expand Up @@ -136,19 +136,27 @@ def decode(string)
in_sequence($sequence)
end

Then /it announces active (.*) version/ do |language|
cmds = {
'ruby' => 'ruby --version',
'php' => 'php --version'
}
cmd = cmds[language]
Then /it announces active (?:php|PHP) version/ do
cmd = 'php --version'

$shell.expects(:execute).
with(cmd).
outputs(cmd).
in_sequence($sequence)
end

Then /it announces active (?:ruby|Ruby) version/ do
$shell.expects(:execute).
with("ruby --version").
outputs("ruby --version").
in_sequence($sequence)

$shell.expects(:execute).
with("gem --version").
outputs("gem --version").
in_sequence($sequence)
end

Then /^it (finds|does not find) the file (.*)$/ do |result, filenames|
filenames = filenames.split(/, | or /).map { |filename| filename.strip }
filenames.each do |filename|
Expand Down
2 changes: 2 additions & 0 deletions features/test_ruby.feature
Expand Up @@ -30,6 +30,7 @@ Feature: Testing a Ruby project
| job:test:log | log: /export TRAVIS_RUBY_VERSION=1.9.2/ |
| job:test:log | log: rvm use 1.9.2 |
| job:test:log | log: ruby --version |
| job:test:log | log: gem --version |
| job:test:log | log: rake |
| job:test:log | log: /Done.* 0/ |
| job:test:finish | finished_at: [now], status: 0 |
Expand Down Expand Up @@ -58,6 +59,7 @@ Feature: Testing a Ruby project
| job:test:log | log: /export TRAVIS_RUBY_VERSION=1.9.2/ |
| job:test:log | log: rvm use 1.9.2 |
| job:test:log | log: ruby --version |
| job:test:log | log: gem --version |
| job:test:log | log: /export BUNDLE_GEMFILE=/ |
| job:test:log | log: bundle install |
| job:test:log | log: bundle exec rake |
Expand Down
1 change: 1 addition & 0 deletions lib/travis/build/job/test/ruby.rb
Expand Up @@ -43,6 +43,7 @@ def uses_bundler?

def announce_ruby
shell.execute("ruby --version")
shell.execute("gem --version")
end

def export_environment_variables
Expand Down
1 change: 1 addition & 0 deletions spec/build/job/test/ruby_spec.rb
Expand Up @@ -25,6 +25,7 @@

it 'announces activated ruby version' do
shell.expects(:execute).with('ruby --version')
shell.expects(:execute).with('gem --version')
job.setup
end

Expand Down

0 comments on commit 6df22f2

Please sign in to comment.