Sha256: 964c693cd7d84b884c0f7a4d40be6a06a53546f47da77c0f6fc1edf25291cb4d

Contents?: true

Size: 674 Bytes

Versions: 1

Compression:

Stored size: 674 Bytes

Contents

# frozen_string_literal: true

describe Rake::Funnel::Extensions::REXML::Functions do # rubocop:disable RSpec/FilePath
  let(:xml) do
    <<XML
  <editors xmlns="http://example.com">
    <editor id="emacs">EMACS</editor>
    <editor id="vi">VIM</editor>
    <editor id="notepad">Notepad</editor>
  </editors>
XML
  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

1 entries across 1 versions & 1 rubygems

Version Path
rake-funnel-0.22.3 spec/rake/funnel/extensions/rexml_spec.rb