Sha256: 783d2834c34a7502bf589195b15fe51c6fbff80e2984d50be3f998f17a4cba1f
Contents?: true
Size: 1.43 KB
Versions: 3
Compression:
Stored size: 1.43 KB
Contents
require 'spec_helper' require 'ronin/formatting/extensions/html/integer' describe Integer do subject { 0x26 } it "should provide String#html_escape" do should respond_to(:html_escape) end it "should provide String#format_html" do should respond_to(:format_html) end it "should provide String#js_escape" do should respond_to(:js_escape) end it "should provide String#format_js" do should respond_to(:format_js) end describe "#html_escape" do let(:html_escaped) { "&" } it "should HTML escape itself" do subject.html_escape.should == html_escaped end end describe "#format_html" do let(:formatted_html) { "&" } it "should HTML format all chars" do subject.format_html.should == formatted_html end end describe "#js_escape" do let(:special_byte) { 0x0a } let(:escaped_special_byte) { '\n' } let(:normal_byte) { 0x41 } let(:normal_char) { 'A' } it "should escape special JavaScript characters" do special_byte.js_escape.should == escaped_special_byte end it "should ignore normal characters" do normal_byte.js_escape.should == normal_char end end describe "#format_js" do let(:js_escaped) { "%26" } it "should JavaScript format ascii bytes" do subject.format_js.should == js_escaped end it "should JavaScript format unicode bytes" do 0xd556.format_js.should == "%uD556" end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ronin-support-0.2.0 | spec/formatting/html/integer_spec.rb |
ronin-support-0.2.0.rc2 | spec/formatting/html/integer_spec.rb |
ronin-support-0.2.0.rc1 | spec/formatting/html/integer_spec.rb |