minitest-implicit-subject 1.0.0 → 1.1.0
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,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmU1ZWNiMTJkNjZjMDY0NjYyZTNlNzJhMjZkMzYyMmRjZDg3NjNjOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTk3MzVjYzMxNDhhZmNhNWQzMDNkNDk1NTQxZmUwYTQ2Njk3OThmOQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTlhYWYzNmExMTkzZjBmN2ViMTRkODY0ODBhOTYxMWE2YjM2NThlMDkwNDFk
|
10
|
+
NDNmNmFkODc2NGYwNDQ5ZDc2YzMxYWIzZDBmMTJiYjA0OGI5OWRjMGQ4Mzhh
|
11
|
+
ODZmMWY3OGE2OWY1ZmQzMDE4ODQwNzAwNzUxNjI5NTEwYTJiMWU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDdkNGMyMWI5YjQyNTM4NWIzZjI1MjMwYjcwYTdmM2I5YTJjZWIyYTQ1Zjhh
|
14
|
+
N2Y1OWE1MjNhZmE5MWQ1NjQyOTYyYmY0ZmYzN2JlZDZhNDQ2YTUyM2ZjMzg4
|
15
|
+
MTIxZDY4ZTRlMjUxY2M4NDY0YWZlZDQzOGE5ZmE4YWI2OGZkNzk=
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'minitest/spec'
|
2
|
+
require 'singleton'
|
2
3
|
|
3
4
|
module Kernel
|
4
5
|
alias_method :alias_describe, :describe
|
@@ -8,6 +9,8 @@ module Kernel
|
|
8
9
|
subject = args.first
|
9
10
|
|
10
11
|
if !subject.is_a?(String) && !cls.instance_methods.include?(:subject)
|
12
|
+
subject = subject.instance if subject.included_modules.include?(Singleton)
|
13
|
+
|
11
14
|
cls.subject { subject }
|
12
15
|
end
|
13
16
|
|
@@ -21,3 +21,15 @@ describe 'missing subject' do
|
|
21
21
|
respond_to?(:subject).must_equal false
|
22
22
|
end
|
23
23
|
end
|
24
|
+
|
25
|
+
describe 'singleton subject' do
|
26
|
+
klass = Class.new do
|
27
|
+
include Singleton
|
28
|
+
end
|
29
|
+
|
30
|
+
describe klass do
|
31
|
+
it 'defines the singleton instance as the subject' do
|
32
|
+
subject.must_equal klass.instance
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-implicit-subject
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Lindqvist
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.7.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.7.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: awesome_print
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,8 +74,8 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- lib/minitest/implicit/subject.rb
|
77
|
-
- spec/lib/
|
78
|
-
homepage: http://github.com/mptre/minitest-
|
77
|
+
- spec/lib/minitest/implicit/subject_spec.rb
|
78
|
+
homepage: http://github.com/mptre/minitest-implicit-subject
|
79
79
|
licenses:
|
80
80
|
- MIT
|
81
81
|
metadata: {}
|
@@ -101,4 +101,4 @@ specification_version: 4
|
|
101
101
|
summary: Implicitly define the test subject as any non string argument pass to a describe
|
102
102
|
block.
|
103
103
|
test_files:
|
104
|
-
- spec/lib/
|
104
|
+
- spec/lib/minitest/implicit/subject_spec.rb
|