Sha256: be700328ef50de5821ff677b8ecc99a057690f9f6fe596a68c203f9bce1782d8

Contents?: true

Size: 450 Bytes

Versions: 39

Compression:

Stored size: 450 Bytes

Contents

require 'rspec/matchers'

RSpec::Matchers.define :have_command_like do |regex|
  match do |command_list|
    @found = command_list.find{|c| c =~ regex }
    !!@found
  end

  failure_message_for_should do |command_list|
    "Didn't find a command matching #{regex} in commands:\n\n" + command_list.join("\n\n")
  end

  failure_message_for_should_not do |command_list|
    "Found unwanted command:\n\n#{@found}\n\n(matches regex #{regex})"
  end
end

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
crazy-yard-3.2.2 spec/support/matchers.rb
engineyard-3.2.5 spec/support/matchers.rb
engineyard-3.2.4 spec/support/matchers.rb
engineyard-3.2.3 spec/support/matchers.rb
engineyard-4.0.0.pre3 spec/support/matchers.rb
engineyard-4.0.0.pre2 spec/support/matchers.rb
engineyard-4.0.0.pre1 spec/support/matchers.rb
engineyard-3.2.1 spec/support/matchers.rb
engineyard-3.2.0 spec/support/matchers.rb
engineyard-3.1.3 spec/support/matchers.rb
engineyard-3.1.2 spec/support/matchers.rb
engineyard-3.1.1 spec/support/matchers.rb
engineyard-3.1.0 spec/support/matchers.rb
engineyard-3.0.1 spec/support/matchers.rb
engineyard-3.0.0 spec/support/matchers.rb
engineyard-2.3.3 spec/support/matchers.rb
engineyard-2.3.2 spec/support/matchers.rb
engineyard-2.3.1 spec/support/matchers.rb
engineyard-2.3.0 spec/support/matchers.rb
engineyard-2.2.1 spec/support/matchers.rb