mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
23c2e197c8
- updated minitest to 5.0 - Removed Test::Unit::TestCase and started using Minitest::Test instead - Fixed usage of assert_raise - Fixed usage of refute_nil - Fixed and removed usage of assert_nothing_raised
20 lines
619 B
Ruby
20 lines
619 B
Ruby
# encoding: UTF-8
|
|
require File.expand_path('../helper', __FILE__)
|
|
require 'erb'
|
|
|
|
class BaseTest < Minitest::Test
|
|
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
|