Class: Snapdragon::Suite
- Inherits:
-
Object
- Object
- Snapdragon::Suite
- Defined in:
- lib/snapdragon/suite.rb
Instance Method Summary collapse
- #filtered? ⇒ Boolean
- #formatter ⇒ Object
-
#initialize(options, paths) ⇒ Suite
constructor
A new instance of Suite.
- #jasmine_ver ⇒ Object
- #pattern ⇒ Object
- #require_file_relative_url_paths ⇒ Object
- #require_files ⇒ Object
- #spec_files ⇒ Object
- #spec_query_param ⇒ Object
- #use_color? ⇒ Boolean
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(, paths) @options = @paths = paths end |
Instance Method Details
#filtered? ⇒ 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 |
#formatter ⇒ Object
10 11 12 |
# File 'lib/snapdragon/suite.rb', line 10 def formatter @options.format end |
#jasmine_ver ⇒ Object
22 23 24 |
# File 'lib/snapdragon/suite.rb', line 22 def jasmine_ver @options.jasmine_ver end |
#pattern ⇒ Object
18 19 20 |
# File 'lib/snapdragon/suite.rb', line 18 def pattern @options.pattern end |
#require_file_relative_url_paths ⇒ Object
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_files ⇒ Object
38 39 40 |
# File 'lib/snapdragon/suite.rb', line 38 def require_files return get_require_files_from_files(spec_files) end |
#spec_files ⇒ Object
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_param ⇒ Object
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
14 15 16 |
# File 'lib/snapdragon/suite.rb', line 14 def use_color? @options.color end |