Module: TestDots

Defined in:
lib/test_dots.rb,
lib/test_dots/api.rb,
lib/test_dots/version.rb,
lib/test_dots/configuration.rb,
lib/test_dots/rspec_listener.rb,
lib/test_dots/ci_adapters/base.rb,
lib/test_dots/ci_adapters/jenkins.rb,
lib/test_dots/ci_adapters/circle_ci.rb,
lib/test_dots/ci_adapters/travis_ci.rb

Defined Under Namespace

Modules: CIAdapters Classes: Api, Configuration, RSpecListener

Constant Summary collapse

VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.configurationObject



14
15
16
# File 'lib/test_dots.rb', line 14

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



25
26
27
# File 'lib/test_dots.rb', line 25

def self.configure
  yield(configuration)
end

.hostObject



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

def self.host
  configuration.host
end

.register_rspec_listenerObject



18
19
20
21
22
23
# File 'lib/test_dots.rb', line 18

def self.register_rspec_listener
  if configuration.collect_test_data?
    require 'test_dots/rspec_listener'
    TestDots::RSpecListener.register
  end
end

.send_report(attributes) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/test_dots.rb', line 33

def self.send_report(attributes)
  ci_adapter = configuration.ci_adapter
  api = TestDots::Api.new

  attributes = attributes.merge(
    gem_version: TestDots::VERSION,
    ci_adapter: ci_adapter.class.to_s,
    url: ci_adapter.url,
    build: ci_adapter.build,
    branch: ci_adapter.branch,
  )

  api.post(attributes.to_json)
end