Module: Specdown::Config

Extended by:
Config
Included in:
Config
Defined in:
lib/specdown/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#expectationsObject

Returns the value of attribute expectations.



5
6
7
# File 'lib/specdown/config.rb', line 5

def expectations
  @expectations
end

#formatObject

Returns the value of attribute format.



9
10
11
# File 'lib/specdown/config.rb', line 9

def format
  @format
end

#reporterObject

Returns the value of attribute reporter.



8
9
10
# File 'lib/specdown/config.rb', line 8

def reporter
  @reporter
end

#rootObject

Returns the value of attribute root.



7
8
9
# File 'lib/specdown/config.rb', line 7

def root
  @root
end

#testsObject

Returns the value of attribute tests.



6
7
8
# File 'lib/specdown/config.rb', line 6

def tests
  @tests
end

Instance Method Details

#implicit_specsObject



38
39
40
41
42
# File 'lib/specdown/config.rb', line 38

def implicit_specs
  return @implicit_specs if @implicit_specs
  implicit_spec_files = find_implicit_specs_in(root).map {|file| File.read(file)}
  @implicit_specs = Specdown::ImplicitParser.parse *implicit_spec_files
end

#reset!Object



19
20
21
22
23
24
# File 'lib/specdown/config.rb', line 19

def reset!
  @expectations = nil
  @reporter     = nil
  @root         = nil
  @format       = nil
end

#test_environment_filesObject



58
59
60
61
62
63
64
65
66
67
# File 'lib/specdown/config.rb', line 58

def test_environment_files
  unless @test_environment_files
    @test_environment_files = Dir["#{root}/**/*.rb"]
    unless root[0..0] == "/"
      @test_environment_files.map! {|file| File.join Dir.pwd, file}
    end
  end

  @test_environment_files
end