Sha256: 9de83b2efd534b756477baf0be4b12fbe4edb895550071034a65e3d7c0be291d

Contents?: true

Size: 479 Bytes

Versions: 8

Compression:

Stored size: 479 Bytes

Contents

# frozen_string_literal: true

require "spec_helpers"

describe Wayfarer::Stringify do
  let(:klass) do
    Class.new(Struct.new(:a, :b, :c, :d)) do
      include Wayfarer::Stringify

      stringify :a, :c, :d
    end
  end

  subject(:instance) { klass.new(1, 2.0, :three, "four") }

  before { stub_const("Foobar", klass) }

  describe "#to_s" do
    it "returns the expected string" do
      expect(instance.to_s).to eq('#<Foobar a=1, c=:three, d="four">')
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
wayfarer-0.4.7 spec/stringify_spec.rb
wayfarer-0.4.6 spec/stringify_spec.rb
wayfarer-0.4.5 spec/stringify_spec.rb
wayfarer-0.4.4 spec/stringify_spec.rb
wayfarer-0.4.3 spec/stringify_spec.rb
wayfarer-0.4.2 spec/stringify_spec.rb
wayfarer-0.4.1 spec/stringify_spec.rb
wayfarer-0.4.0 spec/stringify_spec.rb