Sha256: 164629ce3ac35113038380dcf977e96564062cffa16e712c0d21887878cc97e7
Contents?: true
Size: 491 Bytes
Versions: 11
Compression:
Stored size: 491 Bytes
Contents
require 'spec_helper' describe Virtus::Coercion::Object, '.to_hash' do subject { object.to_hash(value) } let(:object) { described_class } let(:value) { stub('value') } context 'when the value responds to #to_hash' do let(:coerced) { stub('coerced') } before do value.should_receive(:to_hash).with().and_return(coerced) end it { should be(coerced) } end context 'when the value does not respond to #to_hash' do it { should be(value) } end end
Version data entries
11 entries across 11 versions & 2 rubygems