Sha256: e4a67dc75fe5401e123d1ce38b7b1241d759f72927adfc7fa3c99be8430a2d40

Contents?: true

Size: 643 Bytes

Versions: 4

Compression:

Stored size: 643 Bytes

Contents

require 'stackable_flash/test_helpers'

module StackableFlash
  module RspecMatchers
    include StackableFlash::TestHelpers
    RSpec::Matchers.define :have_stackable_flash do |expecting|
      define_method :has_stackable_flash? do |slash|
        flash_in_stack(slash, expecting)
      end

      match{|slash| has_stackable_flash?(slash)}

      failure_message_for_should do |slash|
        "expected flash to be or include #{expected.inspect}, but got #{slash}"
      end
      failure_message_for_should_not do |slash|
        "expected flash to not be and not include #{expected.inspect}, but got #{slash}"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
stackable_flash-0.1.1 lib/stackable_flash/rspec_matchers.rb
stackable_flash-0.0.7 lib/stackable_flash/rspec_matchers.rb
stackable_flash-0.0.6 lib/stackable_flash/rspec_matchers.rb
stackable_flash-0.0.5 lib/stackable_flash/rspec_matchers.rb