require 'rewritepclint'
describe Rewritepclint do
it 'should replace the files array with a prefixed version' do
original = <<-eos
bla
bla
bla
\\test\\test.cpp 8 Info 715
Symbol 'argc' (line 6) not referenced
test\\test.cpp 6 Info 830
Location cited in prior message
..\\test\\test.cpp 8 Info 715
Symbol 'args' (line 6) not referenced
blub
blub
blub
eos
should_be_plist = <<-eos
/test/test.cpp 8 Info 715
Symbol 'argc' (line 6) not referenced
prefix/test/test.cpp 6 Info 830
Location cited in prior message
test/test.cpp 8 Info 715
Symbol 'args' (line 6) not referenced
eos
new_content = Rewritepclint.with(prefix: 'prefix', content: original)
new_content.should eq(should_be_plist)
end
end