sus 0.9.0 → 0.10.1

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: 34208c06066d1f09d5a32350e26efc277bbd6d322df448bd55cec6070ea15c09
4
- data.tar.gz: 9969914ac2241c539244e362e876096c5d0c7dbe95e830db021d6dc46965c5c3
3
+ metadata.gz: 62b0520b1ea3639b141a0b0808d1d4b3949c94750bd9e168e4cf23e4f8282804
4
+ data.tar.gz: 145f2f4dc24b7d3f1f05287acf43e21289f4ec29c0b331641dfe03589884f344
5
5
  SHA512:
6
- metadata.gz: 8fcf93e09b4e3f60a7ff2f01805bf3a11679f219ad382117b023fc575ae2ada0cb0126151d87922d3b5d2a5c384dc0ae42617332142802b580e09aaa68bb54db
7
- data.tar.gz: 6c3600065acc4e25a0adf4473fbd0e87ae1901a1238802a4baedf1a45f3c556b6b8d4d46c7b8eb540c87c64d9c82350302c77c669c942fa39c3d713c052d7ac2
6
+ metadata.gz: bc3adde570b2c5eca67612dbc20b78d85af042b1caeb9846c8a7b38c7bbd1b333bc734e6fe6bd8e9711c486fdf72c268f2788d2e28f076a7017a78da5b2d7123
7
+ data.tar.gz: 0bd7224f611782ad494dcb4c6a63f0237e2c5bf621a021954eab6e55c2adbf1baf9e57e13d14529bd55bd8e91ef57573d5bbb28131629a298a209f65aa29a848
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/sus/base.rb CHANGED
@@ -1,6 +1,5 @@
1
1
 
2
2
  require_relative 'context'
3
- require_relative 'loader'
4
3
 
5
4
  module Sus
6
5
  # The base test case class. We need to be careful about what local state is stored.
data/lib/sus/config.rb CHANGED
@@ -22,7 +22,6 @@
22
22
 
23
23
  require_relative 'clock'
24
24
  require_relative 'registry'
25
- require_relative 'loader'
26
25
 
27
26
  module Sus
28
27
  class Config
@@ -58,6 +57,21 @@ module Sus
58
57
  @verbose = verbose
59
58
 
60
59
  @clock = Clock.new
60
+
61
+ self.add_default_load_paths
62
+ end
63
+
64
+ def add_load_path(path)
65
+ path = ::File.expand_path(path, @root)
66
+
67
+ if ::File.directory?(path)
68
+ $LOAD_PATH.unshift(path)
69
+ end
70
+ end
71
+
72
+ def add_default_load_paths
73
+ add_load_path('lib')
74
+ add_load_path('fixtures')
61
75
  end
62
76
 
63
77
  attr :root
@@ -85,20 +99,9 @@ module Sus
85
99
  @registry ||= self.load_registry
86
100
  end
87
101
 
88
- def base
89
- Sus.base
90
- end
91
-
92
- def setup_base(base)
93
- base.extend(Loader)
94
- base.define_singleton_method(:require_root) {self.root}
95
- end
96
-
97
102
  def load_registry
98
103
  registry = Sus::Registry.new
99
104
 
100
- self.setup_base(registry.base)
101
-
102
105
  if @paths&.any?
103
106
  registry = Sus::Filter.new(registry)
104
107
  @paths.each do |path|
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright, 2022, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in
13
+ # all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ # THE SOFTWARE.
22
+
23
+ module Sus
24
+ module Fixtures
25
+ end
26
+ end
data/lib/sus/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sus
4
- VERSION = "0.9.0"
4
+ VERSION = "0.10.1"
5
5
  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.9.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -37,7 +37,7 @@ cert_chain:
37
37
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
38
38
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
39
39
  -----END CERTIFICATE-----
40
- date: 2022-08-21 00:00:00.000000000 Z
40
+ date: 2022-08-24 00:00:00.000000000 Z
41
41
  dependencies: []
42
42
  description:
43
43
  email:
@@ -61,13 +61,13 @@ files:
61
61
  - lib/sus/expect.rb
62
62
  - lib/sus/file.rb
63
63
  - lib/sus/filter.rb
64
+ - lib/sus/fixtures.rb
64
65
  - lib/sus/have_duration.rb
65
66
  - lib/sus/identity.rb
66
67
  - lib/sus/include_context.rb
67
68
  - lib/sus/it.rb
68
69
  - lib/sus/it_behaves_like.rb
69
70
  - lib/sus/let.rb
70
- - lib/sus/loader.rb
71
71
  - lib/sus/mock.rb
72
72
  - lib/sus/output.rb
73
73
  - lib/sus/output/backtrace.rb
metadata.gz.sig CHANGED
Binary file
data/lib/sus/loader.rb DELETED
@@ -1,11 +0,0 @@
1
- module Sus
2
- module Loader
3
- def require_library(path)
4
- require(::File.join(self.require_root, "lib", path))
5
- end
6
-
7
- def require_fixture(path)
8
- require(::File.join(self.require_root, "fixtures", path))
9
- end
10
- end
11
- end