Module: RailChaser

Defined in:
lib/rail_chaser.rb,
lib/rail_chaser/task.rb,
lib/rail_chaser/storage.rb,
lib/rail_chaser/version.rb,
lib/rail_chaser/configuration.rb,
lib/rail_chaser/example_collection.rb

Defined Under Namespace

Classes: Configuration, ExampleCollection, Storage, Task

Constant Summary collapse

VERSION =
'0.0.3'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.collectionObject

Returns the value of attribute collection.



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

def collection
  @collection
end

.configObject

Returns the value of attribute config.



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

def config
  @config
end

.storageObject

Returns the value of attribute storage.



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

def storage
  @storage
end

Class Method Details

.finishObject



28
29
30
31
# File 'lib/rail_chaser.rb', line 28

def finish
  set_trace_func(nil)
  @storage.save!(@collection)
end

.on {|@config| ... } ⇒ Object

Yields:



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/rail_chaser.rb', line 9

def on
  @config = Configuration.new
  yield @config if block_given?

  @collection = ExampleCollection.new(@config.example_collection_options)
  @storage = Storage.create(@config.storage_options)

  RSpec.configure do |config|
    config.before(:suite) { start }
    config.after(:suite) { finish }
  end
end

.startObject



22
23
24
25
26
# File 'lib/rail_chaser.rb', line 22

def start
  set_trace_func proc { |event, file, line, method, binding, klass|
    @collection.add_example(file)
  }
end