Permalink
Browse files

handle language being set as an array in .travis.yml gracefully

  • Loading branch information...
1 parent 657d6e2 commit 14f94da9db34068e3a9153865682c41e546088ba @svenfuchs svenfuchs committed Nov 19, 2012
Showing with 6 additions and 0 deletions.
  1. +1 −0 lib/travis/model/job/queue.rb
  2. +5 −0 spec/travis/model/job/queue_spec.rb
@@ -12,6 +12,7 @@ class << self
def for(job)
slug = job.repository.try(:slug)
language = job.config[:language]
+ language = language.flatten.compact.first if language.is_a?(Array)
queues.detect { |queue| queue.send(:matches?, slug, language) } || default
end
@@ -29,6 +29,11 @@ def queue(*args)
job = stub('job', :config => { :language => 'clojure' }, :repository => stub('repository', :slug => 'travis-ci/travis-ci'))
Job::Queue.for(job).name.should == 'builds.clojure'
end
+
+ it 'handles language being passed as an array gracefully' do
+ job = stub('job', :config => { :language => ['clojure'] }, :repository => stub('repository', :slug => 'travis-ci/travis-ci'))
+ Job::Queue.for(job).name.should == 'builds.clojure'
+ end
end
describe 'Queue.queues' do

0 comments on commit 14f94da

Please sign in to comment.