minitest-implicit-subject 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDhjYzg5OTEwZWU0MTA5ZGU3MzFiZTdhNzkyMjc3YzA1ZGRkYjU2OQ==
4
+ NmU1ZWNiMTJkNjZjMDY0NjYyZTNlNzJhMjZkMzYyMmRjZDg3NjNjOA==
5
5
  data.tar.gz: !binary |-
6
- MDllMTkxZTljZGMyMDI5NjAyZTM0M2U1YzJiOWRlYTQ3MGQwZmIxMA==
6
+ MTk3MzVjYzMxNDhhZmNhNWQzMDNkNDk1NTQxZmUwYTQ2Njk3OThmOQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NGRkMDYxMWQwMzBlNWE0OWM4MjNiZWQ3MmI2NGI4MDZiNjBlNzUyOTUxNTBi
10
- NjQ2N2QxMTllM2M3NzI1OGY4ZWUxZmY3YTNhNWM5NDU0YWY4ZDM4N2ZhNGYy
11
- ZmY5ZmI1YjY4YWM4MTFiNGUzZDBhYmEyNzhkMjc4ZTc4MzczNzI=
9
+ MTlhYWYzNmExMTkzZjBmN2ViMTRkODY0ODBhOTYxMWE2YjM2NThlMDkwNDFk
10
+ NDNmNmFkODc2NGYwNDQ5ZDc2YzMxYWIzZDBmMTJiYjA0OGI5OWRjMGQ4Mzhh
11
+ ODZmMWY3OGE2OWY1ZmQzMDE4ODQwNzAwNzUxNjI5NTEwYTJiMWU=
12
12
  data.tar.gz: !binary |-
13
- OTM1NTljN2I1YTJiZTM4MzBjNjlhMTQyYmE0YjZlOWNhMTllNDk0ZDc4Njlm
14
- MmI2OTc1MGNmZjcxZTQxOTUwMDNiNjkwM2NiYjk3YzJkYTEwMWRkNmZlNjhh
15
- YjEwMmMxYjg5OTQ1MDY1ZGYwOGEwNGRiMmViNGY5MzNjYTNkOGY=
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.0.0
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-03-12 00:00:00.000000000 Z
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: '0'
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: '0'
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/core_ext/kernel_spec.rb
78
- homepage: http://github.com/mptre/minitest-Implicit-subject
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/core_ext/kernel_spec.rb
104
+ - spec/lib/minitest/implicit/subject_spec.rb