Sha256: 15feb26329403f58a81cd6fc4cb4dc14c8f4a70ed250c462b7e63ae1a64a66fd

Contents?: true

Size: 586 Bytes

Versions: 2

Compression:

Stored size: 586 Bytes

Contents

module Helpers
  def stub_metadata(additional_metadata)
    stub_metadata = metadata_with(additional_metadata)
    RSpec::Core::ExampleGroup.stub(:metadata) { stub_metadata }
  end

  def metadata_with(additional_metadata)
    m = RSpec::Core::Metadata.new
    m.process("example group")

    group_metadata = additional_metadata.delete(:example_group)
    if group_metadata
      m[:example_group].merge!(group_metadata)
    end
    m.merge!(additional_metadata)
    m
  end

  RSpec.configure {|c| c.include self}
end

class Hash
  def but key
    select {|k, _| k != key }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rspec-sequel-0.0.2 spec/support/helpers.rb
rspec-sequel-0.0.1 spec/support/helpers.rb