[前][次][番号順一覧][スレッド一覧]

ruby-changes:52419

From: nobu <ko1@a...>
Date: Tue, 4 Sep 2018 12:41:49 +0900 (JST)
Subject: [ruby-changes:52419] nobu:r64628 (trunk): Spec updates [Bug #15060] [Fix GH-1495]

nobu	2018-09-04 12:41:44 +0900 (Tue, 04 Sep 2018)

  New Revision: 64628

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64628

  Log:
    Spec updates [Bug #15060] [Fix GH-1495]
    
    From: MSP-Greg <greg.mpls@g...>

  Modified files:
    trunk/spec/ruby/core/encoding/converter/search_convpath_spec.rb
    trunk/spec/ruby/optional/capi/spec_helper.rb
Index: spec/ruby/optional/capi/spec_helper.rb
===================================================================
--- spec/ruby/optional/capi/spec_helper.rb	(revision 64627)
+++ spec/ruby/optional/capi/spec_helper.rb	(revision 64628)
@@ -21,7 +21,9 @@ def compile_extension(name) https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/spec_helper.rb#L21
   lib = "#{object_path}/#{ext}.#{RbConfig::CONFIG['DLEXT']}"
   ruby_header = "#{RbConfig::CONFIG['rubyhdrdir']}/ruby.h"
   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
     mtime = File.mtime(lib)
   rescue Errno::ENOENT
Index: spec/ruby/core/encoding/converter/search_convpath_spec.rb
===================================================================
--- spec/ruby/core/encoding/converter/search_convpath_spec.rb	(revision 64627)
+++ spec/ruby/core/encoding/converter/search_convpath_spec.rb	(revision 64628)
@@ -1,11 +1,20 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/encoding/converter/search_convpath_spec.rb#L1
+# frozen_string_literal: true
+
 require_relative '../../../spec_helper'
 
 with_feature :encoding do
   describe "Encoding::Converter.search_convpath" do
     before :all do
-      @perms = Encoding.name_list.permutation(2).map do |pair|
-        Encoding::Converter.search_convpath(pair.first, pair.last) rescue []
-      end
+      t = []
+      temp = ''.dup
+#      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
 
     it "returns an Array" do
@@ -64,10 +73,18 @@ with_feature :encoding do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/encoding/converter/search_convpath_spec.rb#L73
     end
 
     it "raises an Encoding::ConverterNotFoundError if no conversion path exists" do
-      lambda do
-        Encoding::Converter.search_convpath(
-          Encoding::ASCII_8BIT, Encoding::Emacs_Mule)
-      end.should raise_error(Encoding::ConverterNotFoundError)
+#      lambda do
+#        Encoding::Converter.search_convpath(
+#          Encoding::ASCII_8BIT, Encoding::Emacs_Mule)
+#      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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]