Sha256: cc234da0b08c9a15f520f30af2895ba14075b973175a7f4af0a666418828fe7e

Contents?: true

Size: 606 Bytes

Versions: 7

Compression:

Stored size: 606 Bytes

Contents

# encoding: UTF-8
require File.dirname(__FILE__) + '/helper'

class BaseTest < Test::Unit::TestCase
  setup do
    @base = Sinatra.new(Sinatra::Base)
    @base.set :views, File.dirname(__FILE__) + "/views"
  end

  it 'allows unicode strings in ascii templates per default (1.9)' do
    next unless defined? Encoding
    @base.new.haml(File.read(@base.views + "/ascii.haml").encode("ASCII"), {}, :value => "åkej")
  end

  it 'allows ascii strings in unicode templates per default (1.9)' do
    next unless defined? Encoding
    @base.new.haml(:utf8, {}, :value => "Some Lyrics".encode("ASCII"))
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sinatra-1.1.4 test/encoding_test.rb
sinatra-1.1.3 test/encoding_test.rb
sinatra-1.2.0.c test/encoding_test.rb
sinatra-1.1.2 test/encoding_test.rb
sinatra-1.2.0.a test/encoding_test.rb
sinatra-1.1.0 test/encoding_test.rb
sinatra-1.1.b test/encoding_test.rb