File: encoding_implicit.thor

package info (click to toggle)
ruby-thor 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 904 kB
  • sloc: ruby: 9,250; makefile: 8; sh: 1
file content (16 lines) | stat: -rw-r--r-- 394 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

class EncodingImplicit < Thor
  SOME_STRING = "Some λέξεις 一些词 🎉"

  desc "encoding", "tests that encoding is correct"

  def encoding
    puts "#{SOME_STRING.inspect}: #{SOME_STRING.encoding}:"
    if SOME_STRING.encoding.name == "UTF-8"
      puts "ok"
    else
      puts "expected #{SOME_STRING.encoding.name} to equal UTF-8"
    end
  end
end