diff options
author | Benoit Daloze <[email protected]> | 2020-02-28 19:07:17 +0100 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2020-02-28 19:07:17 +0100 |
commit | a0f5ff4c3cd05f8717be2bf1d79f0817f288d398 (patch) | |
tree | 441f409cf816cf8a61dacdbaf204ae9f5cbe2f18 /spec/ruby/library | |
parent | 5d210501825e1682e68cbfc2be424fc339f382fa (diff) |
Update to ruby/spec@41bf282
Diffstat (limited to 'spec/ruby/library')
-rw-r--r-- | spec/ruby/library/cgi/escapeHTML_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/library/stringio/binmode_spec.rb | 14 | ||||
-rw-r--r-- | spec/ruby/library/stringio/inspect_spec.rb | 19 | ||||
-rw-r--r-- | spec/ruby/library/yaml/add_builtin_type_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/yaml/add_domain_type_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/yaml/add_private_type_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/yaml/add_ruby_type_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/yaml/detect_implicit_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/yaml/each_node_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/yaml/emitter_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/yaml/generic_parser_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/yaml/object_maker_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/yaml/parse_documents_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/yaml/parser_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/yaml/quick_emit_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/yaml/read_type_class_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/yaml/transfer_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/library/yaml/try_implicit_spec.rb | 2 |
18 files changed, 37 insertions, 30 deletions
diff --git a/spec/ruby/library/cgi/escapeHTML_spec.rb b/spec/ruby/library/cgi/escapeHTML_spec.rb index dcbfebe720..421aac5d4a 100644 --- a/spec/ruby/library/cgi/escapeHTML_spec.rb +++ b/spec/ruby/library/cgi/escapeHTML_spec.rb @@ -6,6 +6,10 @@ describe "CGI.escapeHTML" do CGI.escapeHTML(%[& < > " ']).should == '& < > " '' end + it "escapes invalid encoding" do + CGI.escapeHTML(%[<\xA4??>]).should == "<\xA4??>" + end + it "does not escape any other characters" do chars = " !\#$%()*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" CGI.escapeHTML(chars).should == chars diff --git a/spec/ruby/library/stringio/binmode_spec.rb b/spec/ruby/library/stringio/binmode_spec.rb index 5d9a8c41df..83178787f3 100644 --- a/spec/ruby/library/stringio/binmode_spec.rb +++ b/spec/ruby/library/stringio/binmode_spec.rb @@ -6,4 +6,18 @@ describe "StringIO#binmode" do io = StringIO.new("example") io.binmode.should equal(io) end + + it "changes external encoding to BINARY" do + io = StringIO.new + io.external_encoding.should == Encoding.find('locale') + io.binmode + io.external_encoding.should == Encoding::BINARY + end + + it "does not set internal encoding" do + io = StringIO.new + io.internal_encoding.should == nil + io.binmode + io.internal_encoding.should == nil + end end diff --git a/spec/ruby/library/stringio/inspect_spec.rb b/spec/ruby/library/stringio/inspect_spec.rb new file mode 100644 index 0000000000..7c02f8d360 --- /dev/null +++ b/spec/ruby/library/stringio/inspect_spec.rb @@ -0,0 +1,19 @@ +require_relative '../../spec_helper' +require "stringio" + +describe "StringIO#inspect" do + it "returns the same as #to_s" do + io = StringIO.new("example") + io.inspect.should == io.to_s + end + + it "does not include the contents" do + io = StringIO.new("contents") + io.inspect.should_not include("contents") + end + + it "uses the regular Object#inspect without any instance variable" do + io = StringIO.new("example") + io.inspect.should =~ /\A#<StringIO:0x\h+>\z/ + end +end diff --git a/spec/ruby/library/yaml/add_builtin_type_spec.rb b/spec/ruby/library/yaml/add_builtin_type_spec.rb deleted file mode 100644 index 44c820940f..0000000000 --- a/spec/ruby/library/yaml/add_builtin_type_spec.rb +++ /dev/null @@ -1,2 +0,0 @@ -require_relative '../../spec_helper' -require_relative 'fixtures/common' diff --git a/spec/ruby/library/yaml/add_domain_type_spec.rb b/spec/ruby/library/yaml/add_domain_type_spec.rb deleted file mode 100644 index 44c820940f..0000000000 --- a/spec/ruby/library/yaml/add_domain_type_spec.rb +++ /dev/null @@ -1,2 +0,0 @@ -require_relative '../../spec_helper' -require_relative 'fixtures/common' diff --git a/spec/ruby/library/yaml/add_private_type_spec.rb b/spec/ruby/library/yaml/add_private_type_spec.rb deleted file mode 100644 index 44c820940f..0000000000 --- a/spec/ruby/library/yaml/add_private_type_spec.rb +++ /dev/null @@ -1,2 +0,0 @@ -require_relative '../../spec_helper' -require_relative 'fixtures/common' diff --git a/spec/ruby/library/yaml/add_ruby_type_spec.rb b/spec/ruby/library/yaml/add_ruby_type_spec.rb deleted file mode 100644 index 44c820940f..0000000000 --- a/spec/ruby/library/yaml/add_ruby_type_spec.rb +++ /dev/null @@ -1,2 +0,0 @@ -require_relative '../../spec_helper' -require_relative 'fixtures/common' diff --git a/spec/ruby/library/yaml/detect_implicit_spec.rb b/spec/ruby/library/yaml/detect_implicit_spec.rb deleted file mode 100644 index 44c820940f..0000000000 --- a/spec/ruby/library/yaml/detect_implicit_spec.rb +++ /dev/null @@ -1,2 +0,0 @@ -require_relative '../../spec_helper' -require_relative 'fixtures/common' diff --git a/spec/ruby/library/yaml/each_node_spec.rb b/spec/ruby/library/yaml/each_node_spec.rb deleted file mode 100644 index 44c820940f..0000000000 --- a/spec/ruby/library/yaml/each_node_spec.rb +++ /dev/null @@ -1,2 +0,0 @@ -require_relative '../../spec_helper' -require_relative 'fixtures/common' diff --git a/spec/ruby/library/yaml/emitter_spec.rb b/spec/ruby/library/yaml/emitter_spec.rb deleted file mode 100644 index 44c820940f..0000000000 --- a/spec/ruby/library/yaml/emitter_spec.rb +++ /dev/null @@ -1,2 +0,0 @@ -require_relative '../../spec_helper' -require_relative 'fixtures/common' diff --git a/spec/ruby/library/yaml/generic_parser_spec.rb b/spec/ruby/library/yaml/generic_parser_spec.rb deleted file mode 100644 index 44c820940f..0000000000 --- a/spec/ruby/library/yaml/generic_parser_spec.rb +++ /dev/null @@ -1,2 +0,0 @@ -require_relative '../../spec_helper' -require_relative 'fixtures/common' diff --git a/spec/ruby/library/yaml/object_maker_spec.rb b/spec/ruby/library/yaml/object_maker_spec.rb deleted file mode 100644 index 44c820940f..0000000000 --- a/spec/ruby/library/yaml/object_maker_spec.rb +++ /dev/null @@ -1,2 +0,0 @@ -require_relative '../../spec_helper' -require_relative 'fixtures/common' diff --git a/spec/ruby/library/yaml/parse_documents_spec.rb b/spec/ruby/library/yaml/parse_documents_spec.rb deleted file mode 100644 index 44c820940f..0000000000 --- a/spec/ruby/library/yaml/parse_documents_spec.rb +++ /dev/null @@ -1,2 +0,0 @@ -require_relative '../../spec_helper' -require_relative 'fixtures/common' diff --git a/spec/ruby/library/yaml/parser_spec.rb b/spec/ruby/library/yaml/parser_spec.rb deleted file mode 100644 index 44c820940f..0000000000 --- a/spec/ruby/library/yaml/parser_spec.rb +++ /dev/null @@ -1,2 +0,0 @@ -require_relative '../../spec_helper' -require_relative 'fixtures/common' diff --git a/spec/ruby/library/yaml/quick_emit_spec.rb b/spec/ruby/library/yaml/quick_emit_spec.rb deleted file mode 100644 index 44c820940f..0000000000 --- a/spec/ruby/library/yaml/quick_emit_spec.rb +++ /dev/null @@ -1,2 +0,0 @@ -require_relative '../../spec_helper' -require_relative 'fixtures/common' diff --git a/spec/ruby/library/yaml/read_type_class_spec.rb b/spec/ruby/library/yaml/read_type_class_spec.rb deleted file mode 100644 index 44c820940f..0000000000 --- a/spec/ruby/library/yaml/read_type_class_spec.rb +++ /dev/null @@ -1,2 +0,0 @@ -require_relative '../../spec_helper' -require_relative 'fixtures/common' diff --git a/spec/ruby/library/yaml/transfer_spec.rb b/spec/ruby/library/yaml/transfer_spec.rb deleted file mode 100644 index 44c820940f..0000000000 --- a/spec/ruby/library/yaml/transfer_spec.rb +++ /dev/null @@ -1,2 +0,0 @@ -require_relative '../../spec_helper' -require_relative 'fixtures/common' diff --git a/spec/ruby/library/yaml/try_implicit_spec.rb b/spec/ruby/library/yaml/try_implicit_spec.rb deleted file mode 100644 index 44c820940f..0000000000 --- a/spec/ruby/library/yaml/try_implicit_spec.rb +++ /dev/null @@ -1,2 +0,0 @@ -require_relative '../../spec_helper' -require_relative 'fixtures/common' |