minitest-implicit-subject 1.1.0 → 1.1.1

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
- NmU1ZWNiMTJkNjZjMDY0NjYyZTNlNzJhMjZkMzYyMmRjZDg3NjNjOA==
4
+ ZTlhNWRlOTUzMGJmN2QwYzA2NGIzNzhiMTY0NGQyNTRmZTgzZGRmYQ==
5
5
  data.tar.gz: !binary |-
6
- MTk3MzVjYzMxNDhhZmNhNWQzMDNkNDk1NTQxZmUwYTQ2Njk3OThmOQ==
6
+ OTRiMjA0Yzk5NzMxYjZiNGY0ZGI3YjNmZTdlN2RlMDQzM2M1NGIxNg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MTlhYWYzNmExMTkzZjBmN2ViMTRkODY0ODBhOTYxMWE2YjM2NThlMDkwNDFk
10
- NDNmNmFkODc2NGYwNDQ5ZDc2YzMxYWIzZDBmMTJiYjA0OGI5OWRjMGQ4Mzhh
11
- ODZmMWY3OGE2OWY1ZmQzMDE4ODQwNzAwNzUxNjI5NTEwYTJiMWU=
9
+ YjMwNGZkY2QyNTdjN2EzZTliMjBlODQ1ODEyNzBlYmU2Mjk1N2E5MGFlYjRk
10
+ NDUzN2U5Yjg5MGQ5ZmU0MDczYzA5MTY2ZDRjYTQyY2M2NDY3NDcyYzRhOGNl
11
+ ZDA1NDY5OGNjZDU1OTgzNGY5MDRkYWMzZTI2Mzc5MzIwYzE0NDY=
12
12
  data.tar.gz: !binary |-
13
- NDdkNGMyMWI5YjQyNTM4NWIzZjI1MjMwYjcwYTdmM2I5YTJjZWIyYTQ1Zjhh
14
- N2Y1OWE1MjNhZmE5MWQ1NjQyOTYyYmY0ZmYzN2JlZDZhNDQ2YTUyM2ZjMzg4
15
- MTIxZDY4ZTRlMjUxY2M4NDY0YWZlZDQzOGE5ZmE4YWI2OGZkNzk=
13
+ MGM3YjA1MjQyYThiOWNjMjg1MDAzNzE4OWQ5ZGJjYjBhN2QwZGExOWI2ZTI4
14
+ MTA0OTlmZGZkOTQxYmNjYjI0NDI3NDJjZWY3YmQ3OGYyYTlhNTJlZDdlN2Vi
15
+ MDBiMTYyYmQxM2VkNmY5OWIzMzdlMzcyODAxMGYxYjRiZWVlMTg=
@@ -9,7 +9,9 @@ module Kernel
9
9
  subject = args.first
10
10
 
11
11
  if !subject.is_a?(String) && !cls.instance_methods.include?(:subject)
12
- subject = subject.instance if subject.included_modules.include?(Singleton)
12
+ if subject.respond_to?(:included_modules) && Array === subject.included_modules && subject.included_modules.include?(Singleton)
13
+ subject = subject.instance
14
+ end
13
15
 
14
16
  cls.subject { subject }
15
17
  end
@@ -26,10 +26,17 @@ describe 'singleton subject' do
26
26
  klass = Class.new do
27
27
  include Singleton
28
28
  end
29
+ struct = OpenStruct.new
29
30
 
30
31
  describe klass do
31
32
  it 'defines the singleton instance as the subject' do
32
33
  subject.must_equal klass.instance
33
34
  end
34
35
  end
36
+
37
+ describe struct do
38
+ it 'does not blow up if the given subject has no included modules' do
39
+ subject.must_equal struct
40
+ end
41
+ end
35
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-implicit-subject
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Lindqvist