diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-05 10:35:30 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-05 10:35:30 +0000 |
commit | 23863ff75d3ec9205d5f365b98b6608e38a93749 (patch) | |
tree | 362b9fc870edb3820ef488a6618baf5669d3aa48 /test/rdoc/test_rdoc_encoding.rb | |
parent | 0d715e1b7540e1c876a4c53862355d5c43dd8683 (diff) |
* lib/rdoc/*, test/rdoc/*: Update rdoc/rdoc master(f191513)
https://github.com/rdoc/rdoc/blob/master/History.rdoc#423--2016--
https://github.com/rdoc/rdoc/blob/master/History.rdoc#422--2016-02-09
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_encoding.rb')
-rw-r--r-- | test/rdoc/test_rdoc_encoding.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_encoding.rb b/test/rdoc/test_rdoc_encoding.rb index 313ede2bde..74d2a2668a 100644 --- a/test/rdoc/test_rdoc_encoding.rb +++ b/test/rdoc/test_rdoc_encoding.rb @@ -217,6 +217,45 @@ class TestRDocEncoding < RDoc::TestCase end end + def test_skip_frozen_string_literal + skip "Encoding not implemented" unless Object.const_defined? :Encoding + + expected = "# frozen_string_literal: false\nhi everybody" + + @tempfile.write expected + @tempfile.flush + + contents = RDoc::Encoding.read_file @tempfile.path, Encoding::UTF_8 + assert_equal "hi everybody", contents + assert_equal Encoding::UTF_8, contents.encoding + end + + def test_skip_frozen_string_literal_after_coding + skip "Encoding not implemented" unless Object.const_defined? :Encoding + + expected = "# coding: utf-8\n# frozen-string-literal: false\nhi everybody" + + @tempfile.write expected + @tempfile.flush + + contents = RDoc::Encoding.read_file @tempfile.path, Encoding::UTF_8 + assert_equal "hi everybody", contents + assert_equal Encoding::UTF_8, contents.encoding + end + + def test_skip_frozen_string_literal_before_coding + skip "Encoding not implemented" unless Object.const_defined? :Encoding + + expected = "# frozen_string_literal: false\n# coding: utf-8\nhi everybody" + + @tempfile.write expected + @tempfile.flush + + contents = RDoc::Encoding.read_file @tempfile.path, Encoding::UTF_8 + assert_equal "hi everybody", contents + assert_equal Encoding::UTF_8, contents.encoding + end + def test_sanity skip "Encoding not implemented" unless Object.const_defined? :Encoding |