Class | CopyrightTest
In: | test/unit/copyright_test.rb
Parent: | Test::Unit::TestCase

Copyright (c) 2006 Logica

### Methods

test01_rb_files

### Public Instance methods

test01_rb_files()

[Source]

        # File test/unit/copyright_test.rb, line 19
    19:   def test01_rb_files
    20:     files = copyright_files(File.expand_path(RAILS_ROOT) + '/app')
    21:     files = files + copyright_files(File.expand_path(RAILS_ROOT) + '/db')
    22:     files = files + copyright_files(File.expand_path(RAILS_ROOT) + '/lib')
    23:     files = files + copyright_files(File.expand_path(RAILS_ROOT) + '/test')
    24:     files = files - [File.expand_path(RAILS_ROOT) + '/db/schema.rb'] # generated file, not in svn
    25:     files_without = []
    26:     files.each do |file|
    27:       content = IO.readlines(file).join
    28:       logger.info('Content:' + content)
    29:       if content =~ /#--(#){70}(\r\n|\n)# Copyright \(c\) 2006 Logica(\r\n|\n)# (\r\n|\n)# All(.)*epl-v10.html(\r\n|\n)#(\r\n|\n)# Contributors:(\r\n|\n)# (.)*#\+\+(#){70}(\r\n|\n)# \{(.)*files\/COPYRIGHT\.html\]/mi
    30:       else
    31:         files_without << file
    32:       end
    33:     end
    34:     logger.info("Files without copyright notice #{files_without.size} from total #{files.size}")
    35:     assert_equal [], files_without
    36:   end

[Validate]