PublicanCreatorsTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 18
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A cleanup() 0 3 1
A check_content() 0 7 2
1
# Testing Module for PublicanCreators
2
# PublicanCreatorsChange
3
# @author Sascha Manns
4
# @abstract Class for all file changes
5
#
6
# Copyright (C) 2015-2017  Sascha Manns <[email protected]>
7
# License: MIT
8
9
# Dependencies
10
require 'fileutils'
11
12
# Class for methods in testing environment
13
class PublicanCreatorsTest
14
  # Method for checking file content
15
  # @param [String] file can be any file
16
  # @param [String] pattern is the searchpattern
17
  # @return [String] result
18
  def self.check_content(file, pattern)
19
    f = File.new(file)
20
    text = f.read
21
    result = 'false' # Default false
22
    result = 'true' if text =~ /"#{pattern}"/ # if found true
23
    return result
24
  end
25
26
  # Method for cleanup the test results
27
  def self.cleanup
28
    system('rm -rf The_holy_Bible*')
29
  end
30
end
31