Sha256: 8ba8dbd455bf57ffb18c92ca7fa8a2d6e7a023a9add1c9b4d19128446ee0b044
Contents?: true
Size: 530 Bytes
Versions: 10
Compression:
Stored size: 530 Bytes
Contents
require 'spec_helper' describe Coercer::Object, '.to_string' do subject { object.to_string(value) } let(:object) { described_class.new } let(:value) { Object.new } context 'when the value responds to #to_str' do let(:coerced) { stub('coerced') } before do value.should_receive(:to_str).with().and_return(coerced) end it { should be(coerced) } end context 'when the value does not respond to #to_str' do specify { expect { subject }.to raise_error(UnsupportedCoercion) } end end
Version data entries
10 entries across 8 versions & 4 rubygems