Sha256: bf46be8a592383ac9c1eb9beee60925e3c7bb1b1cd3c0413dfa13900339624a8

Contents?: true

Size: 446 Bytes

Versions: 14

Compression:

Stored size: 446 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_for_should do |actual|
    %{expected variable #{actual} to have value "#{expected}"}
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
poxy-0.0.6 spec/support/matchers/have_value.rb
poxy-0.0.5 spec/support/matchers/have_value.rb
poxy-0.0.4 spec/support/matchers/have_value.rb
poxy-0.0.1 spec/support/matchers/have_value.rb
poxy-0.0.0 spec/support/matchers/have_value.rb
neat-1.5.1 spec/support/matchers/have_value.rb
neat-1.6.0 spec/support/matchers/have_value.rb
neat-1.6.0.pre2 spec/support/matchers/have_value.rb
neat-1.6.0.pre spec/support/matchers/have_value.rb
neat-1.5.0 spec/support/matchers/have_value.rb
neat-1.5.0.pre spec/support/matchers/have_value.rb
neat-1.4.0 spec/support/matchers/have_value.rb
neat-1.3.0 spec/support/matchers/have_value.rb
neat-1.2.1 spec/support/matchers/have_value.rb