single_cov 0.4.1 → 0.5.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
  SHA1:
3
- metadata.gz: 636161d1f3e826e95b96d611ca0fb79e098a28e8
4
- data.tar.gz: ffb160bb0d4e9b7858c907b7eda89351d154f5b5
3
+ metadata.gz: dc667d156b62b8d5eceae868eaf399c293a79fd9
4
+ data.tar.gz: 52070d8e8472751adb06531c993b9ca106fe8207
5
5
  SHA512:
6
- metadata.gz: 2d5780477f7109011fad076207b3216bee488e64336397d61fdd86cc6bea5c4e7725ff55e57fc479cf3d377983d73258a5421a6b15da1487a5eba08816f99f7a
7
- data.tar.gz: 64abf3c374589d7aa02b31d0a0f0d1521d29dd4f4ccfb246ed64ffc0753948f5c247b4f191f6e65221c2d2d6234f389a52eb2f8d8f2e0b12f6c3560e17a52812
6
+ metadata.gz: 786294b0dbbde29277cfd6f285a54792ff58c15809b81bfa58fabfb0da13009289719b822479b8be35a427b5afc6fd979ab96a1f5f3053d14815d5b319e0dad8
7
+ data.tar.gz: b6d8d5a29fbbd521e8b47c90630a1f23a037dec302032db820f947b26d8226ba00dcc3f5280c45b66a858de71232de2bf122d076cb6d925a7ad550b461f7686e
@@ -1,3 +1,3 @@
1
1
  module SingleCov
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
data/lib/single_cov.rb CHANGED
@@ -162,7 +162,9 @@ module SingleCov
162
162
  raise "#{file} does not exist and cannot be covered." unless File.exist?("#{root}/#{file}")
163
163
  else
164
164
  file = file_under_test(caller[1])
165
- unless File.exist?("#{root}/#{file}")
165
+ if file.start_with?("/")
166
+ raise "Found file #{file} which is not relative to the root #{root}.\nUse `SingleCov.covered file: 'target_file.rb'` to set covered file location."
167
+ elsif !File.exist?("#{root}/#{file}")
166
168
  raise "Tried to guess covered file as #{file}, but it does not exist.\nUse `SingleCov.covered file: 'target_file.rb'` to set covered file location."
167
169
  end
168
170
  end
@@ -235,7 +237,7 @@ module SingleCov
235
237
  end
236
238
 
237
239
  def root
238
- @root ||= (defined?(Bundler) && Bundler.root.to_s) || Dir.pwd
240
+ @root ||= (defined?(Bundler) && Bundler.root.to_s.sub(/\/gemfiles$/, '')) || Dir.pwd
239
241
  end
240
242
  end
241
243
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: single_cov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-01 00:00:00.000000000 Z
11
+ date: 2016-06-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: michael@grosser.it