Sha256: 4d02b9967a72bf4f8b6b70d98b3317a821dfba117390eb86c0f3cf6632cd7869

Contents?: true

Size: 576 Bytes

Versions: 9

Compression:

Stored size: 576 Bytes

Contents

# Don't run specs if HtmlSafeString is not present, eg when running in a rails environment
if defined?(HtmlSafeString)

describe HtmlSafeString do
  
  it 'should be html safe at creation' do
    HtmlSafeString.new.should be_html_safe
  end
  
  it 'should stay html safe after concatenation' do
    s = HtmlSafeString.new('alpha')
    s += 'beta'
    s.should == 'alphabeta'
    s.should be_html_safe
  end
  
  it 'should safely escape dangerous chars on concatenation' do
    s = HtmlSafeString.new('alpha')
    s += 'b&ta'
    s.should == 'alphab&ta'
  end
  
end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
iron-web-1.1.6 spec/web/html_safe_string_spec.rb
iron-web-1.1.5 spec/web/html_safe_string_spec.rb
iron-web-1.1.4 spec/web/html_safe_string_spec.rb
iron-web-1.1.3 spec/web/html_safe_string_spec.rb
iron-web-1.1.2 spec/web/html_safe_string_spec.rb
iron-web-1.1.1 spec/web/html_safe_string_spec.rb
iron-web-1.0.2 spec/web/html_safe_string_spec.rb
iron-web-1.0.1 spec/web/html_safe_string_spec.rb
iron-web-1.0.0 spec/web/html_safe_string_spec.rb