Module: EacRubyGemSupport::Rspec::Setup
- Extended by:
- ActiveSupport::Concern
- Includes:
- EacRubyGemSupport::Rspec::Specs::Rubocop
- Defined in:
- lib/eac_ruby_gem_support/rspec/setup.rb
Constant Summary collapse
- SETUPS =
%w[load_path example_persistence filesystem_helper shared_examples].freeze
Class Method Summary collapse
Instance Method Summary collapse
- #example_persistence_path ⇒ Pathname
-
#root_tmp ⇒ Pathname
The root directory for temporary files.
- #setup_example_persistence ⇒ Object
- #setup_filesystem_helper ⇒ Object
- #setup_load_path ⇒ Object
- #setup_shared_examples ⇒ Object
Methods included from EacRubyGemSupport::Rspec::Specs::Rubocop
Class Method Details
.extended(setup_obj) ⇒ Object
17 18 19 |
# File 'lib/eac_ruby_gem_support/rspec/setup.rb', line 17 def self.extended(setup_obj) SETUPS.each { |s| setup_obj.send("setup_#{s}") } end |
Instance Method Details
#example_persistence_path ⇒ Pathname
41 42 43 |
# File 'lib/eac_ruby_gem_support/rspec/setup.rb', line 41 def example_persistence_path root_tmp.join('example_status_persistence') end |
#root_tmp ⇒ Pathname
The root directory for temporary files.
47 48 49 50 51 52 |
# File 'lib/eac_ruby_gem_support/rspec/setup.rb', line 47 def root_tmp r = ::Pathname.new(::Dir.tmpdir) .join("#{app_root_path..to_path.variableize}_specs_tmp") r.mkpath unless r.exist? r end |
#setup_example_persistence ⇒ Object
31 32 33 |
# File 'lib/eac_ruby_gem_support/rspec/setup.rb', line 31 def setup_example_persistence rspec_config.example_status_persistence_file_path = example_persistence_path.to_path end |
#setup_filesystem_helper ⇒ Object
21 22 23 24 25 |
# File 'lib/eac_ruby_gem_support/rspec/setup.rb', line 21 def setup_filesystem_helper rspec_config.include ::EacRubyGemSupport::Rspec::Helpers::Filesystem rspec_config.include ::EacRubyGemSupport::Rspec::Helpers::Utils rspec_config.after(:each) { purge_temp_files } end |
#setup_load_path ⇒ Object
27 28 29 |
# File 'lib/eac_ruby_gem_support/rspec/setup.rb', line 27 def setup_load_path $LOAD_PATH.push app_root_path.join('lib').to_path end |
#setup_shared_examples ⇒ Object
35 36 37 38 |
# File 'lib/eac_ruby_gem_support/rspec/setup.rb', line 35 def setup_shared_examples require 'eac_ruby_gem_support/rspec/shared_examples/spec_paths' require 'eac_ruby_gem_support/rspec/shared_examples/source_target_fixtures' end |