Module: Assert::Helpers
- Defined in:
- lib/assert/setup/helpers.rb
Constant Summary collapse
- USER_TEST_DIR =
when Assert is required it will automatically require in two helper files if they exist:
-
“./test/helper.rb - package-specific helpers
-
~/.assert.rb - user-specific helpers (options, view, etc…)
the user-specific helper file will always be required in after the package-specific one
-
'./.assert'
- USER_TEST_HELPER =
'options'
Class Method Summary collapse
- .load(caller_info) ⇒ Object
- .package_helper_name ⇒ Object
-
.package_test_dir ⇒ Object
assume the test dir path is ./test and look for helpers in ./test/helper.rb.
- .package_test_helper_regex ⇒ Object
Class Method Details
.load(caller_info) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/assert/setup/helpers.rb', line 27 def load(caller_info) if (crp = caller_root_path(caller_info)) require_package_test_helper(crp) end require_user_test_helper end |
.package_helper_name ⇒ Object
20 21 22 |
# File 'lib/assert/setup/helpers.rb', line 20 def package_helper_name "helper" end |
.package_test_dir ⇒ Object
assume the test dir path is ./test and look for helpers in ./test/helper.rb
17 18 19 |
# File 'lib/assert/setup/helpers.rb', line 17 def package_test_dir "test" end |
.package_test_helper_regex ⇒ Object
23 24 25 |
# File 'lib/assert/setup/helpers.rb', line 23 def package_test_helper_regex /^#{package_test_dir}$|^#{package_test_dir}\/|\/#{package_test_dir}\/|\/#{package_test_dir}$/ end |