spec/pom_spec.rb in maven-tools-0.34.5 vs spec/pom_spec.rb in maven-tools-1.0.0.rc2

- old
+ new

@@ -5,10 +5,12 @@ ( Dir[ File.join( File.dirname( __FILE__ ), 'gem*' ) ] + Dir[ File.join( File.dirname( __FILE__ ), 'pom*' ) ] ).each do |dir| if File.directory?( dir ) it "should convert #{dir}" do pom = Maven::Tools::POM.new( dir ) - pom_xml = File.read( File.join( dir, 'pom.xml' ) ) + file = File.join( dir, 'pom.xml' ) + file = File.join( File.dirname( dir ), 'pom.xml' ) unless File.exists? file + pom_xml = File.read( file ) pom_xml.sub!( /<!--(.|\n)*-->\n/, '' ) pom_xml.sub!( /<?.*?>\n/, '' ) pom_xml.sub!( /<project([^>]|\n)*>/, '<project>' ) pom.to_s.gsub( /#{File.expand_path( dir )}\//, '' ).must_equal pom_xml