Class: Snapdragon::Suite

Inherits:
Object
  • Object
show all
Defined in:
lib/snapdragon/suite.rb

Instance Method Summary collapse

Constructor Details

#initialize(options, paths) ⇒ Suite

Returns a new instance of Suite.



5
6
7
8
# File 'lib/snapdragon/suite.rb', line 5

def initialize(options, paths)
  @options = options
  @paths = paths
end

Instance Method Details

#filtered?Boolean

Returns:

  • (Boolean)


54
55
56
57
58
59
# File 'lib/snapdragon/suite.rb', line 54

def filtered?
  spec_files.each do |spec_file|
    return true if spec_file.filtered?
  end
  return false
end

#formatterObject



10
11
12
# File 'lib/snapdragon/suite.rb', line 10

def formatter
  @options.format
end

#jasmine_verObject



22
23
24
# File 'lib/snapdragon/suite.rb', line 22

def jasmine_ver
  @options.jasmine_ver
end

#patternObject



18
19
20
# File 'lib/snapdragon/suite.rb', line 18

def pattern
  @options.pattern
end

#require_file_relative_url_pathsObject



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/snapdragon/suite.rb', line 42

def require_file_relative_url_paths
  paths = Set.new
  absolute_paths = []
  require_files.each do |file|
    if !absolute_paths.include?(file.absolute_path)
      absolute_paths << file.absolute_path
      paths << file.relative_url_path
    end
  end
  return paths
end

#require_filesObject



38
39
40
# File 'lib/snapdragon/suite.rb', line 38

def require_files
  return get_require_files_from_files(spec_files)
end

#spec_filesObject



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/snapdragon/suite.rb', line 26

def spec_files
  spec_file_objs = []

  @paths << Dir[pattern] if @paths.empty?
  @paths.flatten.uniq.each do |raw_path|
    path = Snapdragon::Path.new(raw_path)
    spec_file_objs.concat(path.spec_files)
  end

  return spec_file_objs
end

#spec_query_paramObject



61
62
63
64
65
66
# File 'lib/snapdragon/suite.rb', line 61

def spec_query_param
  spec_files.each do |spec_file|
    return spec_file.spec_query_param if spec_file.filtered?
  end
  return ''
end

#use_color?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/snapdragon/suite.rb', line 14

def use_color?
  @options.color
end