Module: RSpec::LogSplit

Defined in:
lib/rspec/log_split.rb,
lib/rspec/log_split/config.rb,
lib/rspec/log_split/handler.rb,
lib/rspec/log_split/version.rb

Defined Under Namespace

Classes: Config, Handler

Constant Summary collapse

VERSION =
"0.1.3"

Class Method Summary collapse

Class Method Details

.applyObject


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/rspec/log_split.rb', line 12

def apply
  RSpec.configure do |config|
    config.add_setting :log_split_module
    config.add_setting :log_split_dir
    config.add_setting :log_split

    config.before(:suite) do
      RSpec.configuration.log_split= Config.new(
        RSpec.configuration.log_split_module,
        RSpec.configuration.log_split_dir,
      )
    end

    config.around(:each) do |example|
      RSpec.configuration.log_split.run(example)
    end

    config.after(:suite) do
      Handler.list_logs if $DEBUG
    end
  end
end