minitest-implicit-subject 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MDhjYzg5OTEwZWU0MTA5ZGU3MzFiZTdhNzkyMjc3YzA1ZGRkYjU2OQ==
5
+ data.tar.gz: !binary |-
6
+ MDllMTkxZTljZGMyMDI5NjAyZTM0M2U1YzJiOWRlYTQ3MGQwZmIxMA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NGRkMDYxMWQwMzBlNWE0OWM4MjNiZWQ3MmI2NGI4MDZiNjBlNzUyOTUxNTBi
10
+ NjQ2N2QxMTllM2M3NzI1OGY4ZWUxZmY3YTNhNWM5NDU0YWY4ZDM4N2ZhNGYy
11
+ ZmY5ZmI1YjY4YWM4MTFiNGUzZDBhYmEyNzhkMjc4ZTc4MzczNzI=
12
+ data.tar.gz: !binary |-
13
+ OTM1NTljN2I1YTJiZTM4MzBjNjlhMTQyYmE0YjZlOWNhMTllNDk0ZDc4Njlm
14
+ MmI2OTc1MGNmZjcxZTQxOTUwMDNiNjkwM2NiYjk3YzJkYTEwMWRkNmZlNjhh
15
+ YjEwMmMxYjg5OTQ1MDY1ZGYwOGEwNGRiMmViNGY5MzNjYTNkOGY=
@@ -0,0 +1,16 @@
1
+ require 'minitest/spec'
2
+
3
+ module Kernel
4
+ alias_method :alias_describe, :describe
5
+
6
+ def describe(*args, &block)
7
+ cls = alias_describe(*args, &block)
8
+ subject = args.first
9
+
10
+ if !subject.is_a?(String) && !cls.instance_methods.include?(:subject)
11
+ cls.subject { subject }
12
+ end
13
+
14
+ cls
15
+ end
16
+ end
@@ -0,0 +1,23 @@
1
+ describe 'implicit subject' do
2
+ describe Object do
3
+ it 'defines a implicit subject if anything other than a string is passed to describe' do
4
+ subject.must_equal Object
5
+ end
6
+ end
7
+ end
8
+
9
+ describe 'explicit subject' do
10
+ describe Object do
11
+ subject { 1 }
12
+
13
+ it 'does not overwrite an existing subject' do
14
+ subject.must_equal 1
15
+ end
16
+ end
17
+ end
18
+
19
+ describe 'missing subject' do
20
+ it 'does not define a subject if a string is passed to describe' do
21
+ respond_to?(:subject).must_equal false
22
+ end
23
+ end
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: minitest-implicit-subject
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Anton Lindqvist
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-03-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: minitest
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: awesome_print
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Implicit declaration of the test subject.
70
+ email:
71
+ - anton@qvister.se
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - lib/minitest/implicit/subject.rb
77
+ - spec/lib/core_ext/kernel_spec.rb
78
+ homepage: http://github.com/mptre/minitest-Implicit-subject
79
+ licenses:
80
+ - MIT
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options: []
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ! '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ! '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubyforge_project:
98
+ rubygems_version: 2.0.0
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: Implicitly define the test subject as any non string argument pass to a describe
102
+ block.
103
+ test_files:
104
+ - spec/lib/core_ext/kernel_spec.rb