Remove weird 1.8.7 workarounds in features env

This commit is contained in:
Parker Moore 2013-12-06 01:42:37 -05:00
parent 96ecfb30ef
commit 1297ed5c1d
1 changed files with 4 additions and 16 deletions

View File

@ -1,7 +1,5 @@
if RUBY_VERSION > '1.9' require 'coveralls'
require 'coveralls' Coveralls.wear_merged!
Coveralls.wear_merged!
end
require 'fileutils' require 'fileutils'
require 'rr' require 'rr'
@ -47,15 +45,8 @@ def file_contents(path)
end end
def seconds_agnostic_datetime(datetime = Time.now) def seconds_agnostic_datetime(datetime = Time.now)
pieces = datetime.to_s.split(" ") date, time, zone = datetime.to_s.split(" ")
if pieces.size == 6 # Ruby 1.8.7
date = pieces[0..2].join(" ")
time = seconds_agnostic_time(pieces[3])
zone = pieces[4..5].join(" ")
else # Ruby 1.9.1 or greater
date, time, zone = pieces
time = seconds_agnostic_time(time) time = seconds_agnostic_time(time)
end
[ [
Regexp.escape(date), Regexp.escape(date),
"#{time}:\\d{2}", "#{time}:\\d{2}",
@ -70,6 +61,3 @@ def seconds_agnostic_time(time)
hour, minutes, _ = time.split(":") hour, minutes, _ = time.split(":")
"#{hour}:#{minutes}" "#{hour}:#{minutes}"
end end
# work around "invalid option: --format" cucumber bug (see #296)
Test::Unit.run = true if RUBY_VERSION < '1.9'