crashbreak 1.0.10 → 1.0.11

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: da111887e6b59c26aee1f7562d92f1f45e722975
4
- data.tar.gz: cd18a2e8f7244d98858144dd25edf851cd5630aa
3
+ metadata.gz: 833ab461389988f0aa56ae2beeff61581627ab5f
4
+ data.tar.gz: 39c80a92111e6c28ebeb632da9a899ae3f953d29
5
5
  SHA512:
6
- metadata.gz: 4982fdb475302118c8602769b7bd3d5b647c3ddb5adf6a7753e919f5c2fb356e212c82da369acf12262437150b653c1e1d5793ceffd9d38a14bb98ade7c0463c
7
- data.tar.gz: 4e9e3038299ae08a5e2a01981d20c3ee4342cc3bc7fd99a1b9a96eee3fbede7ee8de512a41033cacd7449d5f11552396d0321673b93a69eea5f51824551d7299
6
+ metadata.gz: aaedc697faa8c58b272e10754a9f49efea7bdf474a316e8bc6c0663466433c8d2558036920e901aeb2c0c3c0153b09058f8fb68bb664b22c45f6f3315eeafc11
7
+ data.tar.gz: 69b818617bf1754a51be59b43e2eecd87bd200f8b19275f79f6e371102c01c05615f6d37b0a72eb4e1e6582315644683e30174da0e0f9c11ec8188efbc9aaa03
@@ -7,11 +7,11 @@ module Crashbreak
7
7
  attr_accessor :dumpers
8
8
  attr_accessor :dumper_options
9
9
  attr_accessor :restorer_options
10
+ attr_accessor :request_spec_file_path
10
11
 
11
12
  attr_accessor :github_login
12
13
  attr_accessor :github_password
13
14
  attr_accessor :github_repo_name
14
- attr_accessor :github_spec_file_path
15
15
  attr_accessor :github_development_branch
16
16
 
17
17
  def exception_notifier
@@ -26,8 +26,8 @@ module Crashbreak
26
26
  @error_serializers ||= []
27
27
  end
28
28
 
29
- def github_spec_file_path
30
- @github_spec_file_path ||= 'spec/crashbreak_error_spec.rb'
29
+ def request_spec_file_path
30
+ @request_spec_file_path ||= 'crashbreak_error_spec.rb'
31
31
  end
32
32
 
33
33
  def github_development_branch
@@ -66,7 +66,7 @@ module Crashbreak
66
66
  end
67
67
 
68
68
  def file_path
69
- Crashbreak.configure.github_spec_file_path
69
+ Crashbreak.configure.request_spec_file_path
70
70
  end
71
71
 
72
72
  def development_branch_name
@@ -1,3 +1,3 @@
1
1
  module Crashbreak
2
- VERSION = '1.0.10'
2
+ VERSION = '1.0.11'
3
3
  end
@@ -5,7 +5,7 @@ module Crashbreak
5
5
  argument :error_id, type: :string
6
6
 
7
7
  def create_test_file
8
- template 'test.rb', 'spec/crashbreak_error_spec.rb'
8
+ template 'test.rb', Crashbreak.configurator.request_spec_file_path
9
9
  end
10
10
  end
11
11
  end
@@ -18,8 +18,8 @@ namespace :crashbreak do
18
18
  error_id = ENV['error_id']
19
19
 
20
20
  unless error_id
21
- next unless File.exist?("#{Rails.root}/spec/crashbreak_error_spec.rb")
22
- error_id = File.read("#{Rails.root}/spec/crashbreak_error_spec.rb").scan(/error id: \d+/).first.gsub('error id: ', '').to_i
21
+ next unless File.exist?("#{Rails.root}/#{Crashbreak.configurator.request_spec_file_path}")
22
+ error_id = File.read("#{Rails.root}/#{Crashbreak.configurator.request_spec_file_path}").scan(/error id: \d+/).first.gsub('error id: ', '').to_i
23
23
  end
24
24
 
25
25
  service = Crashbreak::GithubIntegrationService.new 'id' => error_id
@@ -35,11 +35,11 @@ namespace :crashbreak do
35
35
  end
36
36
 
37
37
  task run_test: :environment do
38
- unless File.exist?("#{Rails.root}/spec/crashbreak_error_spec.rb")
38
+ unless File.exist?("#{Rails.root}/#{Crashbreak.configurator.request_spec_file_path}")
39
39
  next puts 'Crashbreak spec not found, skipping.'
40
40
  end
41
41
 
42
- system('bundle exec rspec spec/crashbreak_error_spec.rb')
42
+ system("bundle exec rspec #{Crashbreak.configurator.request_spec_file_path}")
43
43
  end
44
44
  end
45
45
 
@@ -11,6 +11,6 @@ describe Crashbreak::Generators::TestGenerator do
11
11
  end
12
12
 
13
13
  it 'creates a test' do
14
- assert_file 'spec/error_request_spec.rb', /example_error_id/
14
+ assert_file Crashbreak.configurator.request_spec_file_path, /example_error_id/
15
15
  end
16
16
  end
@@ -14,7 +14,7 @@ describe Crashbreak::GithubIntegrationService do
14
14
  let(:github_deploy_commit_url) { 'https://api.github.com/repos/user/repo/commits/example_deploy_revision' }
15
15
 
16
16
  before(:each) do
17
- Crashbreak.configure.github_spec_file_path = 'spec/crashbreak_error_spec.rb'
17
+ Crashbreak.configure.request_spec_file_path = 'spec/crashbreak_error_spec.rb'
18
18
  allow_any_instance_of(WebMock::Response).to receive(:assert_valid_body!).and_return(true)
19
19
  end
20
20
 
@@ -25,7 +25,7 @@ describe Crashbreak::GithubIntegrationService do
25
25
 
26
26
  stub_request(:post, github_refs_url).with(body: { ref: 'refs/heads/crashbreak-error-1', sha: 'example_deploy_revision'}.to_json)
27
27
 
28
- stub_request(:put, "#{github_create_content_url}/#{Crashbreak.configure.github_spec_file_path}").
28
+ stub_request(:put, "#{github_create_content_url}/#{Crashbreak.configure.request_spec_file_path}").
29
29
  with(body: { branch: branch_name, content: Base64.strict_encode64(file_content), message: 'Add test file for error 1' }.to_json)
30
30
 
31
31
  allow(subject).to receive(:file_content).and_return(file_content)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crashbreak
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Janeczek