Sha256: ef181ec191100f0ac8751388dd6c3587363e06f87864d3532612e8f64e30b26c

Contents?: true

Size: 699 Bytes

Versions: 2

Compression:

Stored size: 699 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

2 entries across 2 versions & 1 rubygems

Version Path
rake-funnel-0.24.0 spec/rake/funnel/extensions/rexml_spec.rb
rake-funnel-0.23.0 spec/rake/funnel/extensions/rexml_spec.rb