Sha256: 95fe68644b56f6ff8dc444f338700d96593d3dad2d4ded8a6c9872e27065b887

Contents?: true

Size: 644 Bytes

Versions: 5

Compression:

Stored size: 644 Bytes

Contents

# rubocop:disable RSpec/FilePath

describe Rake::Funnel::Extensions::REXML::Functions do
  let(:xml) do
    <<EOF
  <editors xmlns="http://example.com">
    <editor id="emacs">EMACS</editor>
    <editor id="vi">VIM</editor>
    <editor id="notepad">Notepad</editor>
  </editors>
EOF
  end

  subject { REXML::Document.new(xml) }

  it 'should support lower-case function' do
    expect(REXML::XPath.match(subject, "//editor[lower-case(text())='vim']").first.to_s).to match(/VIM/)
  end

  it 'should support matches function' do
    expect(REXML::XPath.match(subject, "//editor[matches(@id, '*pad')]").first.to_s).to match(/Notepad/)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rake-funnel-0.21.0 spec/rake/funnel/extensions/rexml_spec.rb
rake-funnel-0.20.2 spec/rake/funnel/extensions/rexml_spec.rb
rake-funnel-0.20.1 spec/rake/funnel/extensions/rexml_spec.rb
rake-funnel-0.20.0 spec/rake/funnel/extensions/rexml_spec.rb
rake-funnel-0.19.0 spec/rake/funnel/extensions/rexml_spec.rb