Sha256: 8ddfe71f24696dfa4f614ccf70a0ec9c1cef28dfe1247177e85de1f1a56423eb

Contents?: true

Size: 437 Bytes

Versions: 1

Compression:

Stored size: 437 Bytes

Contents

RSpec::Matchers.define :be_fresh do |env, old_asset|
  match do |actual|
    if actual.respond_to?(:fresh?)
      if actual.method(:fresh?).arity == 1
        actual.fresh?(env)
      else
        actual.fresh?
      end
    else
      actual.eql?(old_asset)
    end
  end

  failure_message_for_should do |env|
    'expected asset to be fresh'
  end

  failure_message_for_should_not do |env|
    'expected asset to be stale'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sprockets-sass-2.0.0.beta1 spec/support/be_fresh_matcher.rb