Sha256: af1d064b957e314dec1d08dbbb12bbbf8e74e073c47f710c55ddd7f55b4e7770

Contents?: true

Size: 912 Bytes

Versions: 2

Compression:

Stored size: 912 Bytes

Contents

require 'bundler/setup'
require 'minitest/autorun'
require 'minitest/focus'
require 'minitest/pride'
require 'bogus/minitest/spec'
require 'lovely_rufus'
require_relative '../lib/lovely_rufus/layers/layer'
require_relative '../lib/lovely_rufus/wrap'

Bogus.configure do |config|
  config.search_modules << LovelyRufus
  config.search_modules << LovelyRufus::Layers
end

class String
  def dedent
    gsub(/^#{scan(/^ +/).min}/, '')
  end
end

module CustomAssertions
  def assert_passes_to_next(subject, called_with, to_be_passed)
    next_layer = fake(:layer, call: LovelyRufus::Wrap.new)
    subject.new(next_layer).call called_with
    assert_received next_layer, :call, [to_be_passed]
  end
end

Minitest::Test.include CustomAssertions

module Minitest
  module Expectations
    class << LovelyRufus::Layers::Layer
      infect_an_assertion :assert_passes_to_next, :must_pass_to_next, true
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lovely_rufus-0.3.1 test/test_helper.rb
lovely_rufus-0.3.0 test/test_helper.rb