add 1.9.3-rc1 test support and fix #70
This commit is contained in:
parent
c1dc86a329
commit
b04bb49879
18
Rakefile
18
Rakefile
@ -14,12 +14,23 @@ require 'jasmine/headless/task'
|
||||
|
||||
Jasmine::Headless::Task.new
|
||||
|
||||
PLATFORMS = %w{1.8.7 1.9.2 ree 1.9.3-rc1}
|
||||
|
||||
def rvm_bundle(command = '')
|
||||
Bundler.with_clean_env do
|
||||
system %{bash -c 'unset BUNDLE_BIN_PATH && unset BUNDLE_GEMFILE && rvm #{PLATFORMS.join(',')} ruby bundle #{command}'}.tap { |o| p o }
|
||||
end
|
||||
end
|
||||
|
||||
class SpecFailure < StandardError; end
|
||||
class BundleFailure < StandardError; end
|
||||
|
||||
namespace :spec do
|
||||
desc "Run on three Rubies"
|
||||
task :platforms do
|
||||
system %{rvm 1.8.7,1.9.2,ree ruby bundle}
|
||||
system %{rvm 1.8.7,1.9.2,ree ruby bundle exec rake spec}
|
||||
raise StandardError.new if $?.exitstatus != 0
|
||||
rvm_bundle
|
||||
rvm_bundle "exec rspec spec"
|
||||
raise SpecError.new if $?.exitstatus != 0
|
||||
end
|
||||
end
|
||||
|
||||
@ -31,3 +42,4 @@ task :build_runner do
|
||||
system %{ruby extconf.rb}
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
require 'jasmine-core'
|
||||
require 'iconv'
|
||||
require 'time'
|
||||
require 'multi_json'
|
||||
|
||||
@ -64,7 +63,6 @@ module Jasmine
|
||||
alert_time = nil
|
||||
end
|
||||
|
||||
function_locations = {}
|
||||
source = nil
|
||||
|
||||
result = case File.extname(file)
|
||||
|
@ -1,4 +1,3 @@
|
||||
require 'iconv'
|
||||
require 'multi_json'
|
||||
|
||||
module Jasmine::Headless
|
||||
@ -12,8 +11,16 @@ module Jasmine::Headless
|
||||
def action
|
||||
line_numbers = {}
|
||||
|
||||
data = File.read(file)
|
||||
|
||||
if data.respond_to?(:encode)
|
||||
data.encode!('US-ASCII', 'UTF-8', :invalid => :replace)
|
||||
else
|
||||
require 'iconv'
|
||||
ic = Iconv.new('UTF-8//IGNORE', 'US-ASCII')
|
||||
data = ic.iconv(File.read(file) + ' ')[0..-2]
|
||||
end
|
||||
|
||||
data.force_encoding('US-ASCII') if data.respond_to?(:force_encoding)
|
||||
|
||||
data.lines.each_with_index.each { |line, index|
|
||||
|
Loading…
Reference in New Issue
Block a user