mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Spec updates [Bug #15060] [Fix GH-1495]
From: MSP-Greg <greg.mpls@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e4b1172833
commit
3fa8d5ba7b
2 changed files with 27 additions and 8 deletions
|
@ -1,11 +1,20 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative '../../../spec_helper'
|
require_relative '../../../spec_helper'
|
||||||
|
|
||||||
with_feature :encoding do
|
with_feature :encoding do
|
||||||
describe "Encoding::Converter.search_convpath" do
|
describe "Encoding::Converter.search_convpath" do
|
||||||
before :all do
|
before :all do
|
||||||
@perms = Encoding.name_list.permutation(2).map do |pair|
|
t = []
|
||||||
Encoding::Converter.search_convpath(pair.first, pair.last) rescue []
|
temp = ''.dup
|
||||||
end
|
# Encoding.list.reject { |e| e.dummy? }.map { |e| e.to_s }.permutation(2).each { |a| t << a if Array === a }
|
||||||
|
# Encoding.list.map { |e| e.to_s }.permutation(2).each { |a| t << a if Array === a }
|
||||||
|
# Encoding.name_list.permutation(2).each { |a| t << a if Array === a }
|
||||||
|
Encoding.name_list.permutation(2).each { |a| t << a if Array === a }
|
||||||
|
@perms = t.map do |a, b|
|
||||||
|
temp << "#{a.ljust(15)} #{b}"
|
||||||
|
Encoding::Converter.search_convpath(a, b) rescue nil
|
||||||
|
end.compact
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns an Array" do
|
it "returns an Array" do
|
||||||
|
@ -64,10 +73,18 @@ with_feature :encoding do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "raises an Encoding::ConverterNotFoundError if no conversion path exists" do
|
it "raises an Encoding::ConverterNotFoundError if no conversion path exists" do
|
||||||
lambda do
|
# lambda do
|
||||||
Encoding::Converter.search_convpath(
|
# Encoding::Converter.search_convpath(
|
||||||
Encoding::ASCII_8BIT, Encoding::Emacs_Mule)
|
# Encoding::ASCII_8BIT, Encoding::Emacs_Mule)
|
||||||
end.should raise_error(Encoding::ConverterNotFoundError)
|
# end.should raise_error(Encoding::ConverterNotFoundError)
|
||||||
|
begin
|
||||||
|
Encoding::Converter.search_convpath(Encoding::ASCII_8BIT.to_s, Encoding::Emacs_Mule)
|
||||||
|
rescue => e
|
||||||
|
e.class.should == Encoding::ConverterNotFoundError
|
||||||
|
else
|
||||||
|
e.class.should == Encoding::ConverterNotFoundError
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,7 +21,9 @@ def compile_extension(name)
|
||||||
lib = "#{object_path}/#{ext}.#{RbConfig::CONFIG['DLEXT']}"
|
lib = "#{object_path}/#{ext}.#{RbConfig::CONFIG['DLEXT']}"
|
||||||
ruby_header = "#{RbConfig::CONFIG['rubyhdrdir']}/ruby.h"
|
ruby_header = "#{RbConfig::CONFIG['rubyhdrdir']}/ruby.h"
|
||||||
libruby_so = RbConfig::CONFIG['LIBRUBY_SO'] if RbConfig::CONFIG["ENABLE_SHARED"] == "yes"
|
libruby_so = RbConfig::CONFIG['LIBRUBY_SO'] if RbConfig::CONFIG["ENABLE_SHARED"] == "yes"
|
||||||
|
if /mswin|mingw/ =~ RUBY_PLATFORM
|
||||||
|
libruby_so = RbConfig::CONFIG["LIBRUBY"] if RbConfig::CONFIG["ENABLE_SHARED"] == "yes"
|
||||||
|
end
|
||||||
begin
|
begin
|
||||||
mtime = File.mtime(lib)
|
mtime = File.mtime(lib)
|
||||||
rescue Errno::ENOENT
|
rescue Errno::ENOENT
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue