Coveralls logob
Coveralls logo
  • Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lemurheavy / coveralls-ruby / 47

3 Dec 2012 - 13:37 coverage: 50.0%. Remained the same
47

push

travis-ci

Ea81f788f0a5b7d113a0fd7daefb65f5?size=18&default=identiconwilg
[Closes #5] use SimpleCov's 'test_frameworks' options by default

87 of 174 relevant lines covered (50.0%)

3.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

30.3
/lib/coveralls.rb
1
require 'colorize'
6×
2

3
require "coveralls/version"
6×
4
require "coveralls/configuration"
6×
5
require "coveralls/api"
6×
6
require "coveralls/simplecov"
6×
7

8
module Coveralls
6×
9

10
  def self.wear!(simplecov_setting = nil)
6×
11
    setup!
!
12
    start!(simplecov_setting)
!
13
  end
14

15
  def self.setup!
6×
16

17
    # Try to load up SimpleCov.
18
    @@adapter = nil
!
19
    if defined?(::SimpleCov)
!
20
      @@adapter = :simplecov
!
21
    else
22
      begin
!
23
        require 'simplecov'
!
24
        @@adapter = :simplecov if defined?(::SimpleCov)
!
25
      rescue
26
      end
27
    end
28

29
    # Load the appropriate adapter.
30
    if @@adapter == :simplecov
!
31
      ::SimpleCov.formatter = Coveralls::SimpleCov::Formatter
!
32
      puts "[Coveralls] Using the SimpleCov formatter.".green
!
33
    else
34
      puts "[Coveralls] Couldn't find an appropriate adapter.".red
!
35
    end
36

37
  end
38

39
  def self.start!(simplecov_setting = 'test_frameworks')
6×
40
    if @@adapter == :simplecov
!
41
      if simplecov_setting
!
42
        puts "[Coveralls] Using SimpleCov's '#{simplecov_setting}' settings.".green
!
43
        ::SimpleCov.start(simplecov_setting)
!
44
      else
45
        ::SimpleCov.start
!
46
      end
47
    end
48
  end
49

50
  def self.should_run?
6×
51

52
    # Fail early if we're not on Travis
53
    unless ENV["TRAVIS"] || ENV["COVERALLS_RUN_LOCALLY"]
!
54
      puts "[Coveralls] Not saving coverage run because we aren't on Travis CI.".yellow
!
55
      return false
!
56
    end
57

58
    if ENV["COVERALLS_RUN_LOCALLY"] == "true"
!
59
      puts "[Coveralls] Creating a new job on Coveralls from local coverage results.".cyan
!
60
    end
61

62
    true
!
63
  end
64

65
end
Troubleshooting · Open an Issue · Sales · Support · ENTERPRISE · CAREERS · STATUS
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2023 Coveralls, Inc