Class: JasmineParser::FileParser

Inherits:
Object
  • Object
show all
Defined in:
lib/jasmine-parser/file_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(suite) ⇒ FileParser

Returns a new instance of FileParser.



36
37
38
# File 'lib/jasmine-parser/file_parser.rb', line 36

def initialize(suite)
  @suite = suite
end

Instance Attribute Details

#suiteObject

Returns the value of attribute suite.



35
36
37
# File 'lib/jasmine-parser/file_parser.rb', line 35

def suite
  @suite
end

Instance Method Details

#parse(files) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/jasmine-parser/file_parser.rb', line 40

def parse(files)
  raise WrongArgumentTypeForFileParser unless files.kind_of? Array
  Announcer.info "Parsing #{files.size} spec files"
  files.each do |filename|
   raise FileDoesNotExistError unless File.exist? filename
   #TODO: make this parallel if possible
   #ToDO: think of caching of files for large projects
   suite.add_spec_file(parse_file(filename))
  end
  Announcer.info "#{suite.example_count} examples found"
end