sus 0.17.0 → 0.17.2

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
  SHA256:
3
- metadata.gz: 6a328443e5ed5bf8e59b97bfc991017fe0c46a112887b6cd179075b233675658
4
- data.tar.gz: ca7ace995a25c5e034ad27fc14a0bf1f7659a5078bdc9f9db5b904bd9bbff266
3
+ metadata.gz: b86dafae68ebeadfd3e2b7aa2f94e955a05f9b65bf3fcaf1dfdd65a8822a0722
4
+ data.tar.gz: 7714b5ca6dbac3f8a68f386a369c152c2086e1b9d907040c3163f4f7df8b2670
5
5
  SHA512:
6
- metadata.gz: 16d7f6a4d9e5840e7b0cc4b8acc9a5656b70876c5cfc2e378eb4819e26954a07aa774405b51cf863160ac17f7d19a0a2e6984b2d0fee975c254470255b9686f6
7
- data.tar.gz: 35965ea359a3f68d524fb17fe0fd69623f43c536bf8e70c4383474d11987bca4d53ac85c39a678494330603bdaa10be1ad94ba34eaae460172a760a0881b74d3
6
+ metadata.gz: 1d35bd5af4e176105da748d46df24d101e828bd579f6daa32f1907909daa8401abdd73d0bb8f63195ac2c5c787db8af56ec1d7c7131947e0553a7005db0127c6
7
+ data.tar.gz: 510e795dfe14659e2dc2ab166a546c1547b26d2c1476595260ee67124c5d01e162223196057e22635317cac382d399e36a46f8487b6bdc98baa29867b4606966
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/sus/file.rb CHANGED
@@ -33,9 +33,41 @@ module Sus
33
33
  end
34
34
  end
35
35
 
36
+ class FileLoadError
37
+ def self.build(parent, path, error)
38
+ self.new(Identity.new(path), path, error)
39
+ end
40
+
41
+ def initialize(identity, path, error)
42
+ @identity = identity
43
+ @path = path
44
+ @error = error
45
+ end
46
+
47
+ attr :identity
48
+
49
+ def leaf?
50
+ true
51
+ end
52
+
53
+ def print(output)
54
+ output.write("file ", :path, @identity)
55
+ end
56
+
57
+ def call(assertions)
58
+ assertions.nested(self, identity: @identity, isolated: true) do |assertions|
59
+ assertions.error!(@error)
60
+ end
61
+ end
62
+ end
63
+
64
+ private_constant :FileLoadError
65
+
36
66
  module Context
37
67
  def file(path)
38
68
  add File.build(self, path)
69
+ rescue StandardError, LoadError, SyntaxError => error
70
+ add FileLoadError.build(self, path, error)
39
71
  end
40
72
  end
41
73
  end
data/lib/sus/version.rb CHANGED
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2021-2022, by Samuel Williams.
5
5
 
6
6
  module Sus
7
- VERSION = "0.17.0"
7
+ VERSION = "0.17.2"
8
8
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file