Sha256: ae220df49c2c57689378f445bfaa381bae9581e6f83d7a0b48d873f729f81b5b

Contents?: true

Size: 643 Bytes

Versions: 3

Compression:

Stored size: 643 Bytes

Contents

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

3 entries across 3 versions & 1 rubygems

Version Path
rake-funnel-0.22.2 spec/rake/funnel/extensions/rexml_spec.rb
rake-funnel-0.22.1 spec/rake/funnel/extensions/rexml_spec.rb
rake-funnel-0.22.0 spec/rake/funnel/extensions/rexml_spec.rb