Sha256: 348c40c8301ed231caea1c4a508ab317efd010a3fbf96dc37edb51e0c190fc55

Contents?: true

Size: 571 Bytes

Versions: 7

Compression:

Stored size: 571 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Macros::Ctx::Inspect do
  subject(:inspect_step) { described_class.new(key: key) }

  let(:key) { :foo }
  let(:value) { { lorem: :ipsum } }

  let(:ctx) { { foo: value, dolor: :se } }

  it 'expects to print only specified pair key and value' do
    inspect_step.call(ctx)

    expect { print(key => value) }.to output.to_stdout
  end

  context 'key not passed' do
    let(:key) { nil }

    it 'expects to print whole ctx' do
      inspect_step.call(ctx)

      expect { print(ctx) }.to output.to_stdout
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ff-tbl-macros-2.0.2 spec/lib/ctx/inspect_spec.rb
ff-tbl-macros-2.0.1 spec/lib/ctx/inspect_spec.rb
ff-tbl-macros-2.0.0 spec/lib/ctx/inspect_spec.rb
ff-tbl-macros-1.0.2 spec/lib/ctx/inspect_spec.rb
ff-tbl-macros-1.0.1 spec/lib/ctx/inspect_spec.rb
ff-tbl-macros-1.0.0 spec/lib/ctx/inspect_spec.rb
ff-tbl-macros-0.1.8 spec/lib/ctx/inspect_spec.rb