Sha256: c19d9658d97a9aa23d09f3a4224d0d0b531bb52dd32dcc74d2aa4c14d3d9ab2f

Contents?: true

Size: 826 Bytes

Versions: 2

Compression:

Stored size: 826 Bytes

Contents

require 'spec_helper'
require 'helpers/property'

require 'dm-core/property/legacy/html_text'

describe DataMapper::Property::Legacy::HTMLText do
  include Helpers::Property

  before(:all) do
    property(DataMapper::Property::Legacy::HTMLText)
  end

  let(:raw_text) { 'one & two' }
  let(:html_text) { 'one & two' }

  describe "load" do
    it "should load Date Strings" do
      @property.load(html_text).should == raw_text
    end

    it "should not load empty-strings" do
      @property.load('').should be_empty
    end

    it "should not load nil" do
      @property.load(nil).should be_nil
    end
  end

  describe "dump" do
    it "should dump raw text" do
      @property.dump(raw_text).should == html_text
    end

    it "should not dump nil" do
      @property.dump(nil).should be_nil
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dm-types-legacy-0.1.1 spec/unit/html_text_spec.rb
dm-types-legacy-0.1.0 spec/unit/html_text_spec.rb