From f107f471480d1353e4f2374b005dfbaf206453aa Mon Sep 17 00:00:00 2001 From: Jean-Richard Lai Date: Wed, 14 Sep 2016 11:38:03 -0700 Subject: [PATCH] Add key_separator configuration --- README.md | 3 +++ lib/tests_doc/configuration.rb | 1 + lib/tests_doc/interaction.rb | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 71bb5b2..7338db2 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,9 @@ TestsDoc.configure do |config| # Folder name where the tests doc will be stored config.doc_folder = 'api' # default: api + # Key separator between the path and the key + config.key_separator = '@' # default: @ + # Add RSpec line number to the test doc config.add_spec_file_number = false # default: true diff --git a/lib/tests_doc/configuration.rb b/lib/tests_doc/configuration.rb index e998420..5d2ee8b 100644 --- a/lib/tests_doc/configuration.rb +++ b/lib/tests_doc/configuration.rb @@ -20,6 +20,7 @@ def self.config(property, default = nil) config :changes_whitelist_regexes, [] config :root_folder, "tests-doc" config :doc_folder, "api" + config :key_separator, "@" end end diff --git a/lib/tests_doc/interaction.rb b/lib/tests_doc/interaction.rb index 2e87b6f..952da5e 100644 --- a/lib/tests_doc/interaction.rb +++ b/lib/tests_doc/interaction.rb @@ -51,7 +51,7 @@ def response_content end def file_path - [file_base_path, options.key.to_s].reject(&:blank?).compact.join('@') + '.md' + [file_base_path, options.key.to_s].reject(&:blank?).compact.join(TestsDoc.configuration.key_separator) + '.md' end def file_base_path