Sha256: e361b54e9077b825ec9fb6234d13d722b4de1eb7d5135b8f6acd66ce8efc956f

Contents?: true

Size: 669 Bytes

Versions: 1

Compression:

Stored size: 669 Bytes

Contents

require "spec_helper"

RSpec.describe String do
  describe "#to_burlap" do
    subject(:burlap) { input_string.to_burlap }

    context "with normal string" do
      let(:input_string) { "some string" }

      it "returns a string" do
        expect(burlap).to be_a_kind_of(described_class)
      end

      it "is correct" do
        expect(burlap).to eq("<string>some string</string>")
      end
    end

    context "with html unsafe content" do
      let(:input_string) { "<script type='text/js'>hello</script>" }

      it "returns escaped html" do
        expect(burlap).to match(%r{&lt;script type='text/js'&gt;hello&lt;/script&gt;})
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
burlap-1.0.0 spec/burlap/core_ext/string_spec.rb