Sha256: 965486ba5e95cb4d7746a519f5430ae8618a2fa54e8a717906d5b78a901b3f29

Contents?: true

Size: 456 Bytes

Versions: 2

Compression:

Stored size: 456 Bytes

Contents

require 'spec_helper'

describe Coercer::TimeCoercions, '.to_string' do
  subject { object.to_string(value) }

  let(:object)  { coercer.new }
  let(:coercer) { Class.new(Coercer::Object) { include Coercer::TimeCoercions } }
  let(:value)   { mock('value') }

  before do
    object.extend Coercer::TimeCoercions

    value.should_receive(:to_s).and_return('2011-01-01')
  end

  it { should be_instance_of(String) }

  it { should eql('2011-01-01') }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
coercible-0.0.2 spec/unit/coercible/coercer/time_coercions/to_string_spec.rb
coercible-0.0.1 spec/unit/coercible/coercer/time_coercions/to_string_spec.rb