File: encoding_with_utf8.thor

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

class EncodingWithUtf8 < 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