rspec-testrail 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f3cf3e0ea8759d4ce3b9716ef21786244277c1f
4
- data.tar.gz: 72cdfb8d97e88d9427b4be4ab0dc84829428fdd1
3
+ metadata.gz: d75728baba5bfab17c86486fbd91b2eab7f69f3f
4
+ data.tar.gz: 9f187c3bd458ac3e14dfe7fa1cd30b4746514e85
5
5
  SHA512:
6
- metadata.gz: 86fa169d8f3eb4bca53bc9045448b36995191cdaae09fde8d9c1d3bff4bb11338e173605701cdae78802dddf13e7fcfabb65ca82ab798eaf03e536f22842c459
7
- data.tar.gz: 3e1d1278578c13a00ec5d919bbbf4591b3f9d3f42bae15dbbc6a5a51b62ebb546a18ea98257f42c59a39bd528a04e668fcfa48d2023779a53ba9c89da2de50a0
6
+ metadata.gz: 929a6f914077f240bf1d869087399a69b6732099502db83318d48272235f7e80bcaf0846dcd5b8cc1bb19f5a545eee44986edbfe5c3476ac7dc75ba85f54e148
7
+ data.tar.gz: 54165c4c0fef0586214dc662b312ed2beeb1ad575181663a78d10b0666197ce5d96434380e76f197e313a050809ca975a1754a9002ad4b08b16375225006e899
@@ -1,5 +1,9 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
+ - 2.0.0
5
+ - 2.2
4
6
  - 2.3.1
5
- before_install: gem install bundler -v 1.12.4
7
+ before_install: gem install bundler
8
+ notifications:
9
+ email: false
data/Gemfile CHANGED
@@ -6,3 +6,4 @@ gemspec
6
6
  gem 'rubocop'
7
7
  gem 'awesome_print'
8
8
  gem 'pry'
9
+ gem 'codeclimate-test-reporter', group: :test, require: nil
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # RSpec::Testrail
2
2
 
3
+ [![Build Status](https://travis-ci.org/dmitryzuev/rspec-testrail.svg?branch=master)](https://travis-ci.org/dmitryzuev/rspec-testrail) [![Code Climate](https://codeclimate.com/github/dmitryzuev/rspec-testrail/badges/gpa.svg)](https://codeclimate.com/github/dmitryzuev/rspec-testrail) [![Test Coverage](https://codeclimate.com/github/dmitryzuev/rspec-testrail/badges/coverage.svg)](https://codeclimate.com/github/dmitryzuev/rspec-testrail/coverage)
3
4
 
4
5
  ## Installation
5
6
 
@@ -29,11 +30,13 @@ RSpec.configure do |config|
29
30
  config.before :all do
30
31
  # Uncomment if you are using gem `webmock`
31
32
  # WebMock.allow_net_connect!
32
- RSpec::Testrail.init url: 'http://test.site',
33
- user: 'test@test.site',
33
+ RSpec::Testrail.init url: 'http://testrail.site',
34
+ user: 'test@testrail.site',
34
35
  password: ENV.fetch('TESTRAIL_PASSWORD', '12345678'),
35
36
  project_id: 228,
36
- suite_id: 1337
37
+ suite_id: 1337,
38
+ run_name: `git rev-parse --abbrev-ref HEAD`.strip,
39
+ run_description: `git rev-parse HEAD`.strip
37
40
  end
38
41
 
39
42
  config.after :example, testrail_id: proc { |value| !value.nil? } do |example|
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
@@ -13,20 +13,15 @@ module RSpec
13
13
  password: hash[:password],
14
14
  project_id: hash[:project_id],
15
15
  suite_id: hash[:suite_id],
16
- git_revision: `git rev-parse HEAD`.strip,
17
- git_branch: `git rev-parse --abbrev-ref HEAD`.strip
16
+ run_name: hash[:run_name],
17
+ run_description: hash[:run_description]
18
18
  }
19
- client
20
19
  end
21
20
 
22
21
  def client
23
22
  @client ||= Client.new(@options[:url], @options[:user], @options[:password])
24
23
  end
25
24
 
26
- def reset_client
27
- @client = nil
28
- end
29
-
30
25
  def process(example)
31
26
  if example.exception
32
27
  status = 5
@@ -40,6 +35,13 @@ module RSpec
40
35
  comment: message)
41
36
  end
42
37
 
38
+ def reset
39
+ @options = nil
40
+ @client = nil
41
+ @testrun = nil
42
+ @testruns = nil
43
+ end
44
+
43
45
  protected
44
46
 
45
47
  def testrun
@@ -47,11 +49,11 @@ module RSpec
47
49
  if testruns.empty?
48
50
  client.send_post("add_run/#{@options[:project_id]}",
49
51
  suite_id: @options[:suite_id],
50
- name: "Test run for #{@options[:git_branch]}",
51
- description: "Revision: #{@options[:git_revision]}")
52
+ name: @options[:run_name],
53
+ description: @options[:run_description])
52
54
  else
53
55
  client.send_post("update_run/#{testruns[0]['id']}",
54
- description: "Revision: #{@options[:git_revision]}")
56
+ description: @options[:run_description])
55
57
  end
56
58
  end
57
59
 
@@ -59,7 +61,7 @@ module RSpec
59
61
  @testruns ||= client.send_get("get_runs/#{@options[:project_id]}")
60
62
  .select do |run|
61
63
  run['suite_id'] == @options[:suite_id].to_i && \
62
- run['name'].include?(@options[:git_branch])
64
+ run['name'].include?(@options[:run_name])
63
65
  end
64
66
  end
65
67
  end
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Testrail
3
- VERSION = '0.1.1'.freeze
3
+ VERSION = '0.1.2'.freeze
4
4
  end
5
5
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_development_dependency 'bundler', '~> 1.12'
23
+ spec.add_development_dependency 'bundler', '~> 1.10'
24
24
  spec.add_development_dependency 'rake', '~> 10.0'
25
25
  spec.add_development_dependency 'webmock', '~> 2.1'
26
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-testrail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Zuev
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.12'
19
+ version: '1.10'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.12'
26
+ version: '1.10'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement