Sha256: bd82e56fa4de2e317988312ff40738cb84681f98646a2079490423a9229b2203

Contents?: true

Size: 453 Bytes

Versions: 7

Compression:

Stored size: 453 Bytes

Contents

require "#{File.dirname(__FILE__)}/../../spec_helper"

shared_examples_for 'a stringifiable model' do

  # clazz must be defined by the calling file

  let(:model) { clazz.new }


  it 'can provide a custom string representation of itself' do
    expect(model.method(:to_s).owner).to equal(clazz), "#{clazz} does not override #to_s"
  end

  it 'represents itself with as a string' do
    expect(model.to_s).to be_a(String)
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cuke_modeler-1.2.1 testing/rspec/spec/unit/shared/stringifiable_models_unit_specs.rb
cuke_modeler-1.2.0 testing/rspec/spec/unit/shared/stringifiable_models_unit_specs.rb
cuke_modeler-1.1.1 testing/rspec/spec/unit/shared/stringifiable_models_unit_specs.rb
cuke_modeler-1.1.0 testing/rspec/spec/unit/shared/stringifiable_models_unit_specs.rb
cuke_modeler-1.0.4 testing/rspec/spec/unit/shared/stringifiable_models_unit_specs.rb
cuke_modeler-1.0.3 testing/rspec/spec/unit/shared/stringifiable_models_unit_specs.rb
cuke_modeler-1.0.2 testing/rspec/spec/unit/shared/stringifiable_models_unit_specs.rb