Sha256: efbcf8997b735777d76891d7ba75a2b237886ffdd9dfe0c3fd20197fa57178b6

Contents?: true

Size: 435 Bytes

Versions: 7

Compression:

Stored size: 435 Bytes

Contents

RSpec::Matchers.define :have_value do |expected|
  match do |actual|
    selector_id = actual.sub("$","#")
    value_attribute = ParserSupport.parser.find_by_selector(selector_id)[0]

    unless value_attribute.nil?
      actual_value = value_attribute.split(":")[1].strip.sub(";", "")
      actual_value == expected
    end
  end

  failure_message do |actual|
    %{expected variable #{actual} to have value "#{expected}"}
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
neat-1.9.1 spec/support/matchers/have_value.rb
neat-1.9.0 spec/support/matchers/have_value.rb
neat-1.8.0 spec/support/matchers/have_value.rb
neat-1.7.4 spec/support/matchers/have_value.rb
neat-1.7.3 spec/support/matchers/have_value.rb
neat-1.7.2 spec/support/matchers/have_value.rb
neat-1.7.1 spec/support/matchers/have_value.rb