test_dots 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a467e52898dc1852528c61576ee18dd9f74043d8
4
- data.tar.gz: bcf7f771ef4c00f6cd3ba40e603029660033c2e8
3
+ metadata.gz: 22613a9374a0a00f97336369feae7b72b9da50d7
4
+ data.tar.gz: f4a685de0a7edfb82dbf17fe086f24e6959f1bfc
5
5
  SHA512:
6
- metadata.gz: 1125708c5036e636d8324377dc1e4dc85d8c4534ba558dbdacb4177103247f8c2f826f96672b176a44962c8dcd17c1a2fa165db4546ab598ebe9483674245b50
7
- data.tar.gz: c080b6225a22d3b72db698a2ad4aa6bbd25dbd1f45c650c1a6499167a6fd2ec20ce540f75b4aae476080f39913b9724395187c7d90c8acfc3ff8dd8bcb848846
6
+ metadata.gz: c1349306f73b1c2f8be9ff07f105825b990ee5680418ab94230955c833ffe34d11c2d563ffe0e9e0c608db31abb438b11773b93fcd1425d60188ade34214335e
7
+ data.tar.gz: e14f1eba3829fdd302d850d13b52bec8ad8f0af27ece1d5eff4a276de2fb44e214204a6560c16a487bbe15dfe1f2602599b151593da60e8f4c61ebac4407ef2e
data/README.md CHANGED
@@ -18,7 +18,19 @@ end
18
18
  TestDots.register_rspec_listener
19
19
  ```
20
20
 
21
- **3.** Configure your API key by setting the `TEST_DOTS_KEY` environment variable in your continuous integration tool.
21
+ **3.** If you are using a tool such as `WebMock` or `VCR` to prevent connections to the internet in your test environment add an exception for Test Dots.
22
+
23
+ ```ruby
24
+ VCR.config do |c|
25
+ c.ignore_hosts TestDots.host
26
+ end
27
+ ```
28
+
29
+ ```ruby
30
+ WebMock.disable_net_connect!(allow: TestDots.host)
31
+ ```
32
+ **4.** Configure your API key by setting the `TEST_DOTS_KEY` environment variable in your continuous integration tool.
33
+
22
34
 
23
35
  ## Integrating with Test Frameworks
24
36
 
data/lib/test_dots.rb CHANGED
@@ -26,6 +26,10 @@ module TestDots
26
26
  yield(configuration)
27
27
  end
28
28
 
29
+ def self.host
30
+ configuration.host
31
+ end
32
+
29
33
  def self.send_report(attributes)
30
34
  ci_adapter = configuration.ci_adapter
31
35
  api = TestDots::Api.new
data/lib/test_dots/api.rb CHANGED
@@ -3,7 +3,7 @@ require 'openssl'
3
3
  module TestDots
4
4
  class Api
5
5
  def post(payload)
6
- http = Net::HTTP.new(TestDots.configuration.server, TestDots.configuration.port)
6
+ http = Net::HTTP.new(TestDots.configuration.host, TestDots.configuration.port)
7
7
  if TestDots.configuration.use_ssl
8
8
  http.use_ssl = true
9
9
  http.ca_file = TestDots.configuration.cacert_path
@@ -1,10 +1,10 @@
1
1
  module TestDots
2
2
  class Configuration
3
- attr_accessor :enabled, :server, :port, :api_key, :endpoint, :use_ssl, :cacert_path, :ci_adapter
3
+ attr_accessor :enabled, :host, :port, :api_key, :endpoint, :use_ssl, :cacert_path, :ci_adapter
4
4
 
5
5
  def initialize
6
6
  @enabled = true
7
- @server = ENV.fetch('TEST_DOTS_SERVER', 'testdots.com')
7
+ @host = ENV.fetch('TEST_DOTS_HOST', 'testdots.com')
8
8
  @port = port = ENV.fetch('TEST_DOTS_PORT', '443')
9
9
  @api_key = ENV.fetch('TEST_DOTS_KEY', nil)
10
10
  @endpoint = ENV.fetch('TEST_DOTS_ENDPOINT', '/api/v1/builds')
@@ -1,3 +1,3 @@
1
1
  module TestDots
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/test_dots.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
 
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
- f.match(%r{^(test|spec|features)/})
17
+ f.match(%r{^(test|spec|features|examples)/})
18
18
  end
19
19
  spec.files += Dir['resources/*.crt']
20
20
  spec.bindir = "exe"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_dots
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Zetter
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-19 00:00:00.000000000 Z
11
+ date: 2018-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -93,26 +93,6 @@ files:
93
93
  - Rakefile
94
94
  - bin/console
95
95
  - bin/setup
96
- - examples/minitest/Gemfile
97
- - examples/minitest/Gemfile.lock
98
- - examples/minitest/Rakefile
99
- - examples/minitest/test/features/feature_example_test.rb
100
- - examples/minitest/test/test_helper.rb
101
- - examples/minitest/test/units/unit_example_test.rb
102
- - examples/minitest_specs/Gemfile
103
- - examples/minitest_specs/Gemfile.lock
104
- - examples/minitest_specs/example_test.rb
105
- - examples/rspec/Gemfile
106
- - examples/rspec/Gemfile.lock
107
- - examples/rspec/spec/features/feature_example_spec.rb
108
- - examples/rspec/spec/spec_helper.rb
109
- - examples/rspec/spec/units/unit_example_spec.rb
110
- - examples/rspec_custom_adapter/Gemfile
111
- - examples/rspec_custom_adapter/Gemfile.lock
112
- - examples/rspec_custom_adapter/example_spec.rb
113
- - examples/rspec_full/Gemfile
114
- - examples/rspec_full/Gemfile.lock
115
- - examples/rspec_full/example_spec.rb
116
96
  - lib/minitest/test_dots_plugin.rb
117
97
  - lib/test_dots.rb
118
98
  - lib/test_dots/api.rb
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
- source "https://rubygems.org"
3
-
4
- gem "minitest"
5
- gem 'test_dots', path: '../../'
6
- gem 'rake'
@@ -1,21 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- test_dots (0.1.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- minitest (5.10.3)
10
- rake (12.1.0)
11
-
12
- PLATFORMS
13
- ruby
14
-
15
- DEPENDENCIES
16
- minitest
17
- rake
18
- test_dots!
19
-
20
- BUNDLED WITH
21
- 1.15.4
@@ -1,6 +0,0 @@
1
- require 'rake/testtask'
2
-
3
- Rake::TestTask.new do |t|
4
- t.libs << "test"
5
- t.pattern = "test/**/*_test.rb"
6
- end
@@ -1,11 +0,0 @@
1
- require 'test_helper'
2
-
3
- class FeatureExampleTest < Minitest::Test
4
- def test_numerics
5
- assert_equal 1, 1
6
- end
7
-
8
- def test_booleans
9
- assert_equal true, true
10
- end
11
- end
@@ -1,8 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
- require 'test_dots'
4
- require 'minitest/autorun'
5
-
6
- TestDots.configure do |config|
7
- config.use_ssl = false
8
- end
@@ -1,11 +0,0 @@
1
- require 'test_helper'
2
-
3
- class UnitExampleTest < Minitest::Test
4
- def test_it_passes
5
- assert_equal true, true
6
- end
7
-
8
- def test_it_fails
9
- assert_equal true, false
10
- end
11
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
- source "https://rubygems.org"
3
-
4
- gem "minitest"
5
- gem 'test_dots', path: '../../'
@@ -1,19 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- test_dots (0.1.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- minitest (5.10.3)
10
-
11
- PLATFORMS
12
- ruby
13
-
14
- DEPENDENCIES
15
- minitest
16
- test_dots!
17
-
18
- BUNDLED WITH
19
- 1.15.1
@@ -1,20 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
- require "minitest/autorun"
4
- require 'test_dots'
5
-
6
- TestDots.configure do |config|
7
- config.use_ssl = false
8
- end
9
-
10
- describe 'TestExample' do
11
- describe "passing" do
12
- it 'passes' do
13
- assert_equal true, true
14
- end
15
- end
16
-
17
- it 'fails' do
18
- assert_equal true, false
19
- end
20
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
- source "https://rubygems.org"
3
-
4
- gem "rspec"
5
- gem 'test_dots', path: '../../'
@@ -1,32 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- test_dots (0.1.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- diff-lcs (1.3)
10
- rspec (3.6.0)
11
- rspec-core (~> 3.6.0)
12
- rspec-expectations (~> 3.6.0)
13
- rspec-mocks (~> 3.6.0)
14
- rspec-core (3.6.0)
15
- rspec-support (~> 3.6.0)
16
- rspec-expectations (3.6.0)
17
- diff-lcs (>= 1.2.0, < 2.0)
18
- rspec-support (~> 3.6.0)
19
- rspec-mocks (3.6.0)
20
- diff-lcs (>= 1.2.0, < 2.0)
21
- rspec-support (~> 3.6.0)
22
- rspec-support (3.6.0)
23
-
24
- PLATFORMS
25
- ruby
26
-
27
- DEPENDENCIES
28
- rspec
29
- test_dots!
30
-
31
- BUNDLED WITH
32
- 1.15.1
@@ -1,11 +0,0 @@
1
- require 'spec_helper'
2
-
3
- RSpec.describe "feature example" do
4
- it 'works with numbers' do
5
- expect(1).to eq(1)
6
- end
7
-
8
- it 'works with booleans' do
9
- expect(true).to eq(true)
10
- end
11
- end
@@ -1,10 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
- require 'rspec'
4
- require 'test_dots'
5
-
6
- TestDots.configure do |config|
7
- config.use_ssl = false
8
- end
9
-
10
- TestDots.register_rspec_listener
@@ -1,11 +0,0 @@
1
- require 'spec_helper'
2
-
3
- RSpec.describe "unit example" do
4
- it 'is passing' do
5
- expect(true).to be(true)
6
- end
7
-
8
- it 'is failing' do
9
- expect(true).to be(false)
10
- end
11
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
- source "https://rubygems.org"
3
-
4
- gem "rspec"
5
- gem 'test_dots', path: '../../'
@@ -1,32 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- test_dots (0.1.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- diff-lcs (1.3)
10
- rspec (3.6.0)
11
- rspec-core (~> 3.6.0)
12
- rspec-expectations (~> 3.6.0)
13
- rspec-mocks (~> 3.6.0)
14
- rspec-core (3.6.0)
15
- rspec-support (~> 3.6.0)
16
- rspec-expectations (3.6.0)
17
- diff-lcs (>= 1.2.0, < 2.0)
18
- rspec-support (~> 3.6.0)
19
- rspec-mocks (3.6.0)
20
- diff-lcs (>= 1.2.0, < 2.0)
21
- rspec-support (~> 3.6.0)
22
- rspec-support (3.6.0)
23
-
24
- PLATFORMS
25
- ruby
26
-
27
- DEPENDENCIES
28
- rspec
29
- test_dots!
30
-
31
- BUNDLED WITH
32
- 1.16.0
@@ -1,37 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
- require 'rspec'
4
- require 'test_dots'
5
-
6
- class MyAdapter < TestDots::CIAdapters::Base
7
- def build
8
- 'a-build'
9
- end
10
-
11
- def branch
12
- 'a-branch'
13
- end
14
-
15
- def url
16
- 'http://example.com/a-url'
17
- end
18
- end
19
-
20
- TestDots.configure do |config|
21
- config.use_ssl = false
22
- config.ci_adapter = MyAdapter.new
23
- end
24
-
25
- TestDots.register_rspec_listener
26
-
27
- RSpec.describe "example" do
28
- describe 'odd and even' do
29
- it 'returns true' do
30
- expect(2.even?).to be(true)
31
- end
32
-
33
- it 'returns false' do
34
- expect(5.even?).to be(false)
35
- end
36
- end
37
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
- source "https://rubygems.org"
3
-
4
- gem "rspec"
5
- gem 'test_dots', path: '../../'
@@ -1,32 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- test_dots (0.1.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- diff-lcs (1.3)
10
- rspec (3.6.0)
11
- rspec-core (~> 3.6.0)
12
- rspec-expectations (~> 3.6.0)
13
- rspec-mocks (~> 3.6.0)
14
- rspec-core (3.6.0)
15
- rspec-support (~> 3.6.0)
16
- rspec-expectations (3.6.0)
17
- diff-lcs (>= 1.2.0, < 2.0)
18
- rspec-support (~> 3.6.0)
19
- rspec-mocks (3.6.0)
20
- diff-lcs (>= 1.2.0, < 2.0)
21
- rspec-support (~> 3.6.0)
22
- rspec-support (3.6.0)
23
-
24
- PLATFORMS
25
- ruby
26
-
27
- DEPENDENCIES
28
- rspec
29
- test_dots!
30
-
31
- BUNDLED WITH
32
- 1.16.0
@@ -1,57 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
- require 'rspec'
4
- require 'test_dots'
5
-
6
- TestDots.configure do |config|
7
- config.use_ssl = false
8
- end
9
-
10
- TestDots.register_rspec_listener
11
-
12
- RSpec.describe "example" do
13
- describe 'odd and even' do
14
- context 'a group of tests' do
15
- it 'returns true' do
16
- expect(2.even?).to be(true)
17
- end
18
-
19
- it 'returns false' do
20
- expect(5.even?).to be(false)
21
- end
22
- end
23
-
24
- context 'a different' do
25
- it 'returns true' do
26
- expect(3.odd?).to be(true)
27
- end
28
-
29
- it 'returns false' do
30
- expect(6.odd?).to be(false)
31
- end
32
- end
33
- end
34
-
35
- it 'is failing' do
36
- expect(true).to be(false)
37
- end
38
-
39
- it 'errors' do
40
- raise 'hi'
41
- end
42
-
43
- it 'is intermittent' do
44
- random = rand
45
- expect(random).to be > 0.5
46
- end
47
-
48
- it 'it is variably slow' do
49
- sleep(rand * 2)
50
- expect(true).to be(true)
51
- end
52
-
53
- it 'is slow' do
54
- sleep(1.5)
55
- expect(true).to be(true)
56
- end
57
- end