Skip to content

Commit

Permalink
Fix TW-41746 Trouble running rails project with Cucumber in TeamCity
Browse files Browse the repository at this point in the history
Problem was with cucumber < 2.0.0 due to new 'require' introduced ~month ago
  • Loading branch information
VladRassokhin committed Jul 13, 2015
1 parent 1152977 commit 27dd8ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Expand Up @@ -13,14 +13,17 @@
# limitations under the License.

require 'cucumber/formatter/console'
require 'cucumber/core/ast/empty_multiline_argument'
require 'fileutils'

require 'teamcity/runner_common'
require 'teamcity/utils/service_message_factory'
require 'teamcity/utils/runner_utils'
require 'teamcity/utils/url_formatter'

if Teamcity::Cucumber.same_or_newer?('2.0.0.0')
require 'cucumber/core/ast/empty_multiline_argument'
end

module Teamcity
module Cucumber
module FormatterCommons
Expand Down
Expand Up @@ -45,8 +45,13 @@ def self.same_or_newer?(version)
end
cuke_version.each_with_index do |num, i|
gnum = given_version[i]
if num =~ /\d*/ && gnum =~ /\d*/ && num.to_i > gnum.to_i
return true
if num =~ /\d*/ && gnum =~ /\d*/
diff = num.to_i - gnum.to_i
if diff > 0
return true
elsif diff < 0
return false
end
elsif num =~ /\d*/ && gnum =~ /a-zA-Z/
return true
end
Expand Down

0 comments on commit 27dd8ac

Please sign in to comment.