rspec-github 2.1.0 → 2.2.0

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
  SHA256:
3
- metadata.gz: 2c45bd6529aa7e1e0910334fa1092e353f889239154691176620ed3e184f68aa
4
- data.tar.gz: 1b94944e8afeafe41f1308d21d2066fa1e2957d9358dd8850af3bfc1ca668bd6
3
+ metadata.gz: dd0d5193cff4ec8793a8d1a69b3323db05399cb1147d021c51843706beec1cc0
4
+ data.tar.gz: 6be59b0609fdbb16663466df65dae210a16d864d2d14f09158ad7d34884fcefe
5
5
  SHA512:
6
- metadata.gz: 6c1b936cce1073b607aea8ded50994ef7763ceba97e9dff1720661b97c199f05a519c33cbf2c2f0c33cc9b59f30a878560eb6a7e87e895267ad7790670146a4f
7
- data.tar.gz: 11e1446390959fc27aa23a4f7eae725763bfcefbdc546002dd722c36f58ce0f1280a589db24df3d1f831d7d6d1c7e9df42a412f02cc6369d7475472b0f8bc08b
6
+ metadata.gz: 5020e2b3b781740bec68cf841d327251615cdc0b572bdfbb6c0200322d0f975c49797cb270d2602fcdb3a3a1b79e7c67b42999a3b838d76a85a5dd013377781f
7
+ data.tar.gz: a22208bc4c984718be816a9cdc744912bc282acf8d36239f08c411e8a969f551e7ccc05c549e20d7717019b1e01a3885c8ed194b837957dbc9d8f96d4f5a100b
@@ -8,13 +8,20 @@ module RSpec
8
8
  class Formatter < RSpec::Core::Formatters::BaseFormatter
9
9
  RSpec::Core::Formatters.register self, :example_failed, :example_pending
10
10
 
11
+ def self.relative_path(path)
12
+ workspace = File.realpath(ENV.fetch('GITHUB_WORKSPACE', '.'))
13
+ File.realpath(path).delete_prefix("#{workspace}#{File::SEPARATOR}")
14
+ end
15
+
11
16
  def example_failed(failure)
12
17
  file, line = failure.example.location.split(':')
18
+ file = self.class.relative_path(file)
13
19
  output.puts "\n::error file=#{file},line=#{line}::#{failure.message_lines.join('%0A')}"
14
20
  end
15
21
 
16
22
  def example_pending(pending)
17
23
  file, line = pending.example.location.split(':')
24
+ file = self.class.relative_path(file)
18
25
  output.puts "\n::warning file=#{file},line=#{line}::#{pending.example.full_description}"
19
26
  end
20
27
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module Github
5
- VERSION = '2.1.0'
5
+ VERSION = '2.2.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stef Schenkelaars
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-03 00:00:00.000000000 Z
11
+ date: 2020-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-core