Class: EacRubyGemSupport::Rspec::SpecPathsController

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_ruby_gem_support/rspec/spec_paths_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(example, spec_file) ⇒ Object

Parameters:

  • example (RSpec::Core::ExampleGroup)
  • spec_file (Pathname)


14
15
16
# File 'lib/eac_ruby_gem_support/rspec/spec_paths_controller.rb', line 14

common_constructor :example, :spec_file do
  self.spec_file = spec_file.to_pathname
end

Instance Attribute Details

#spec_filePathname (readonly)

Returns:

  • (Pathname)


# File 'lib/eac_ruby_gem_support/rspec/spec_paths_controller.rb', line 8

Instance Method Details

#fixtures_directoryPathname

Returns:

  • (Pathname)


19
20
21
# File 'lib/eac_ruby_gem_support/rspec/spec_paths_controller.rb', line 19

def fixtures_directory
  spec_directory.join(spec_file.basename('.*')).basename_sub { |b| "#{b}_files" }
end

#spec_directoryPathname

Returns:

  • (Pathname)


24
25
26
# File 'lib/eac_ruby_gem_support/rspec/spec_paths_controller.rb', line 24

def spec_directory
  spec_file.parent
end