Module: Bidi2pdf::TestHelpers::SpecPathsHelper
- Defined in:
- lib/bidi2pdf/test_helpers/spec_paths_helper.rb
Overview
This submodule contains path-related helper methods and configuration for tests.
Instance Method Summary collapse
-
#fixture_dir ⇒ String
Retrieves the directory path for Docker files.
-
#fixture_file ⇒ String
Retrieves the directory path for fixtures.
-
#random_tmp_dir(*dirs, prefix: nil) ⇒ String
Generates a random temporary directory path.
-
#spec_dir ⇒ String
Retrieves the directory path for specs.
-
#tmp_dir ⇒ String
Retrieves the directory path for temporary files.
-
#tmp_file(*parts) ⇒ String
Generates a path for a temporary file by joining the temporary directory with the given parts.
Instance Method Details
#fixture_dir ⇒ String
Retrieves the directory path for Docker files.
11 12 13 |
# File 'lib/bidi2pdf/test_helpers/spec_paths_helper.rb', line 11 def fixture_dir TestHelpers.configuration.fixture_dir end |
#fixture_file ⇒ String
Retrieves the directory path for fixtures.
17 18 19 |
# File 'lib/bidi2pdf/test_helpers/spec_paths_helper.rb', line 17 def fixture_file(*) File.join(fixture_dir, *) end |
#random_tmp_dir(*dirs, prefix: nil) ⇒ String
Generates a random temporary directory path.
44 45 46 47 48 |
# File 'lib/bidi2pdf/test_helpers/spec_paths_helper.rb', line 44 def random_tmp_dir(*dirs, prefix: nil) base_dirs = [tmp_dir] + dirs.compact pfx = prefix || TestHelpers.configuration.prefix File.join(*base_dirs, "#{pfx}#{SecureRandom.hex(8)}") end |
#spec_dir ⇒ String
Retrieves the directory path for specs.
23 24 25 |
# File 'lib/bidi2pdf/test_helpers/spec_paths_helper.rb', line 23 def spec_dir TestHelpers.configuration.spec_dir end |
#tmp_dir ⇒ String
Retrieves the directory path for temporary files.
29 30 31 |
# File 'lib/bidi2pdf/test_helpers/spec_paths_helper.rb', line 29 def tmp_dir TestHelpers.configuration.tmp_dir end |
#tmp_file(*parts) ⇒ String
Generates a path for a temporary file by joining the temporary directory with the given parts.
36 37 38 |
# File 'lib/bidi2pdf/test_helpers/spec_paths_helper.rb', line 36 def tmp_file(*parts) File.join(tmp_dir, *parts) end |