Sha256: b8b3d539e382a14152d60504266c27e72ab87fcf3925f91ce9b06eefefb4c2de

Contents?: true

Size: 674 Bytes

Versions: 1

Compression:

Stored size: 674 Bytes

Contents

require 'pr/fields/generic_field'

describe 'a generic field' do
  let(:klass) { PR::Fields::GenericField }
  let(:value) { double "value" }
  let(:field) { klass.new value }

  describe "default value" do
    subject { klass.new }

    its(:raw)     { should == nil }
    its(:convert) { should == nil }
  end

  describe :raw do
    it "should return the value the field was initialized with" do
      field.raw.should == value
    end
  end

  describe "#populate" do
    subject { field.populate value }
    specify { field.raw.should == value }
  end

  describe :convert do
    it "should return the raw value" do
      field.convert.should == value
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pr-0.0.1 spec/unit/pr/fields/generic_field_spec.rb