Module: RSpecProf::FilenameHelpers
- Included in:
- RSpecProf
- Defined in:
- lib/rspec-prof/filename_helpers.rb
Class Attribute Summary collapse
-
.file_extension ⇒ Object
Returns the value of attribute file_extension.
-
.output_dir ⇒ Object
Returns the value of attribute output_dir.
Instance Method Summary collapse
- #file_extension ⇒ Object
- #filename_for(example) ⇒ Object
- #output_dir ⇒ Object
- #path_for(metadata) ⇒ Object
Class Attribute Details
.file_extension ⇒ Object
Returns the value of attribute file_extension.
8 9 10 |
# File 'lib/rspec-prof/filename_helpers.rb', line 8 def file_extension @file_extension end |
.output_dir ⇒ Object
Returns the value of attribute output_dir.
7 8 9 |
# File 'lib/rspec-prof/filename_helpers.rb', line 7 def output_dir @output_dir end |
Instance Method Details
#file_extension ⇒ Object
15 16 17 |
# File 'lib/rspec-prof/filename_helpers.rb', line 15 def file_extension RSpecProf::FilenameHelpers.file_extension end |
#filename_for(example) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rspec-prof/filename_helpers.rb', line 27 def filename_for example path = path_for(example.[:example_group]) line_number = example.[:line_number].to_s description = example.[:description] File.join( output_dir, path, description ).gsub(/\s+/, '-') + ":" + line_number + ".#{file_extension}" end |
#output_dir ⇒ Object
11 12 13 |
# File 'lib/rspec-prof/filename_helpers.rb', line 11 def output_dir RSpecProf::FilenameHelpers.output_dir end |
#path_for(metadata) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/rspec-prof/filename_helpers.rb', line 19 def path_for if [:parent_example_group] File.join(path_for([:parent_example_group]), [:description]) else [:description] end end |