summaryrefslogtreecommitdiff
path: root/spec/ruby/core/encoding/aliases_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/encoding/aliases_spec.rb')
-rw-r--r--spec/ruby/core/encoding/aliases_spec.rb43
1 files changed, 43 insertions, 0 deletions
diff --git a/spec/ruby/core/encoding/aliases_spec.rb b/spec/ruby/core/encoding/aliases_spec.rb
new file mode 100644
index 0000000000..12c6c6cf85
--- /dev/null
+++ b/spec/ruby/core/encoding/aliases_spec.rb
@@ -0,0 +1,43 @@
+require_relative '../../spec_helper'
+
+describe "Encoding.aliases" do
+ it "returns a Hash" do
+ Encoding.aliases.should.instance_of?(Hash)
+ end
+
+ it "has Strings as keys" do
+ Encoding.aliases.keys.each do |key|
+ key.should.instance_of?(String)
+ end
+ end
+
+ it "has Strings as values" do
+ Encoding.aliases.values.each do |value|
+ value.should.instance_of?(String)
+ end
+ end
+
+ it "has alias names as its keys" do
+ Encoding.aliases.key?('BINARY').should == true
+ Encoding.aliases.key?('ASCII').should == true
+ end
+
+ it "has the names of the aliased encoding as its values" do
+ Encoding.aliases['BINARY'].should == 'ASCII-8BIT'
+ Encoding.aliases['ASCII'].should == 'US-ASCII'
+ end
+
+ it "has an 'external' key with the external default encoding as its value" do
+ Encoding.aliases['external'].should == Encoding.default_external.name
+ end
+
+ it "has a 'locale' key and its value equals the name of the encoding found by the locale charmap" do
+ Encoding.aliases['locale'].should == Encoding.find(Encoding.locale_charmap).name
+ end
+
+ it "only contains valid aliased encodings" do
+ Encoding.aliases.each do |aliased, original|
+ Encoding.find(aliased).should == Encoding.find(original)
+ end
+ end
+end
'>2021-07-28[ruby/digest] Also drop to support Ruby 2.4Hiroshi SHIBATA https://github.com/ruby/digest/commit/360a7de366 2021-07-28[ruby/digest] Use Gemfile instead of ↵Hiroshi SHIBATA Gem::Specification#add_development_dependency https://github.com/ruby/digest/commit/460a6f807e 2021-07-28[ruby/digest] Drop to support Ruby 2.3Hiroshi SHIBATA https://github.com/ruby/digest/commit/23dc9c7425 2021-07-28[ruby/digest] gemspec: Avoid distributing extraneous filesOlle Jonsson https://github.com/ruby/digest/commit/0a451e0c94 2021-07-28[ruby/digest] gemspec: Explicitly have 0 executablesOlle Jonsson https://github.com/ruby/digest/commit/086d54ba94 2021-07-28[ruby/digest] Experiment: Use a .pre version in gemspecOlle Jonsson This makes it slightly more explicit that this is not a definite new version. https://github.com/ruby/digest/commit/2bb5bb78a3 2021-07-28[ruby/digest] Experiment: bump patch versionOlle Jonsson This is a test, to see if the build failures are about the shipped Ruby master version of this gem. https://github.com/ruby/digest/commit/d2606b2cce 2020-12-21[ruby/digest] Remove .gitignore and .travis.yml from gemspecKenta Murata https://github.com/ruby/digest/commit/7b57b73f46 2020-12-19[digest] Version 3.0.0Kenta Murata https://github.com/ruby/digest/commit/4bbd247a32 2020-12-03[ruby/digest] LICENSEHiroshi SHIBATA https://github.com/ruby/digest/commit/aa048ce345 2020-12-03[ruby/digest] Fixup d981714348f71177132426e3ac19598e1b2e8f5dHiroshi SHIBATA https://github.com/ruby/digest/commit/502a12587c 2020-10-19Followed up with 708413807ae958afb79257b18475424e0a8a4a56Hiroshi SHIBATA * Added sync task for digest * Update doc/* for default gems * Update the latest version of gemspec 2020-10-19Revisit to promote digest to default gems.Hiroshi SHIBATA This reverts commit f39021be7e0eac20ef7f06592769955ea482470f. 2017-12-19Remove digest.gemspec for default gems.hsbt It needs to support header file installation and uninstallation. But current RubyGems didn't support it feature yet. From: SHIBATA Hiroshi <hsbt@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2017-08-16Added gemspec of digest library.hsbt standalone repository is https://github.com/ruby/digest [Misc #13771][ruby-core:82179] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e