require 'gcc_to_clang_analyzer/rewrite_plist_file' describe RewritePlistFile do it 'should replace the files array with a prefixed version' do original = <<-eos clang_version clang version 3.4 (trunk 182989) files src/eeprommanager/main1.cpp src/eeprommanager/main2.cpp eos should_be_plist = <<-eos clang_version clang version 3.4 (trunk 182989) files test/src/eeprommanager/main1.cpp test/src/eeprommanager/main2.cpp eos should_be_plist.strip! new_plist = RewritePlistFile.with_prefix('test', original) new_plist.should eq(should_be_plist) end it 'should do nothing for empty file arrays' do original = <<-eos clang_version clang version 3.4 (trunk 182989) files eos new_file = RewritePlistFile.with_prefix('test', original) new_file.should eq(original.strip) end end