Sha256: 018bcd7bd45d094d401fb7f63629caf3b7c97f3653a6dbfb87cb23327865889e

Contents?: true

Size: 436 Bytes

Versions: 9

Compression:

Stored size: 436 Bytes

Contents

require 'spec_helper'

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

  let(:object) { Class.new(Virtus::Coercion::Object) }
  let(:value)  { mock('value')                       }

  before do
    object.extend Virtus::Coercion::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

9 entries across 9 versions & 2 rubygems

Version Path
virtus-0.5.5 spec/unit/virtus/coercion/time_coercions/to_string_spec.rb
virtus-0.5.4 spec/unit/virtus/coercion/time_coercions/to_string_spec.rb
virtus-0.5.3 spec/unit/virtus/coercion/time_coercions/to_string_spec.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/virtus-0.5.2/spec/unit/virtus/coercion/time_coercions/to_string_spec.rb
virtus-0.5.2 spec/unit/virtus/coercion/time_coercions/to_string_spec.rb
virtus-0.5.1 spec/unit/virtus/coercion/time_coercions/to_string_spec.rb
virtus-0.5.0 spec/unit/virtus/coercion/time_coercions/to_string_spec.rb
virtus-0.4.2 spec/unit/virtus/coercion/time_coercions/to_string_spec.rb
virtus-0.4.1 spec/unit/virtus/coercion/time_coercions/to_string_spec.rb