Sha256: 4cb487efe646f748b9ef0d93ea258ba6d3b8dd0ee90e927c2ecf868a41c66925

Contents?: true

Size: 620 Bytes

Versions: 10

Compression:

Stored size: 620 Bytes

Contents

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

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!.erb(File.read(@base.views + "/ascii.erb").encode("ASCII"), {}, :value => "åkej")
  end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sinatra-1.2.9 test/encoding_test.rb
sinatra-1.2.8 test/encoding_test.rb
sinatra-1.2.7 test/encoding_test.rb
sinatra-1.2.6 test/encoding_test.rb
sinatra-1.3.0.d test/encoding_test.rb
sinatra-1.3.0.c test/encoding_test.rb
sinatra-1.2.3 test/encoding_test.rb
sinatra-1.2.2 test/encoding_test.rb
sinatra-1.3.0.b test/encoding_test.rb
sinatra-1.3.0.a test/encoding_test.rb