minitest-spec-context 0.0.3 → 0.0.4
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 +7 -0
- data/README.md +19 -1
- data/lib/minitest-spec-context.rb +8 -0
- data/minitest-spec-context.gemspec +3 -1
- data/test/context_test.rb +13 -0
- metadata +23 -12
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2fa36eae2dabc798e99126404dff8c84612770f28d4c446ac3a352c9a5c5e7cb
|
4
|
+
data.tar.gz: 2582a2a43460abd5efe283d11e6bb9749e147e0f547f33574ebc23a9a65110b8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: dccf940ec45839e7bc2238c9c7415f5a7d293361c8b0998db4104197642d84e1c2b6b560bf1dc678ecabf24d62ed907ef251fa29aafbda947970bd6eefb56198
|
7
|
+
data.tar.gz: ff68837bb52d07333507fe7198145b9f509af0e945e64ccbb57c51ca656bffe0ee4a28413b9739f8bf116e3121e3a6a131d62de408976dbf77a9ca33eed87b53
|
data/README.md
CHANGED
@@ -18,6 +18,14 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
+
Require the gem in the `test_helper`:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require "minitest-spec-context"
|
25
|
+
```
|
26
|
+
|
27
|
+
And now you can use it:
|
28
|
+
|
21
29
|
```ruby
|
22
30
|
|
23
31
|
describe "#method" do
|
@@ -33,8 +41,18 @@ describe "#method" do
|
|
33
41
|
end
|
34
42
|
end
|
35
43
|
```
|
44
|
+
The ```context``` method is available only in the nested blocks. One cannot use it in the outside most block. I simply do not desire to introduce a new method in ruby ```Kernel``` module
|
45
|
+
|
46
|
+
The ```context``` method is also available on ```ActiveSupport::TestCase```, for use within Rails applications.
|
36
47
|
|
37
|
-
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
class ActiveSupport::TestCase
|
51
|
+
context "when using Rails" do
|
52
|
+
...
|
53
|
+
end
|
54
|
+
end
|
55
|
+
```
|
38
56
|
|
39
57
|
## Contributing
|
40
58
|
|
@@ -11,5 +11,7 @@ Gem::Specification.new do |gem|
|
|
11
11
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
12
12
|
gem.name = "minitest-spec-context"
|
13
13
|
gem.require_paths = ["lib"]
|
14
|
-
gem.version = '0.0.
|
14
|
+
gem.version = '0.0.4'
|
15
|
+
|
16
|
+
gem.add_development_dependency "activesupport", "~> 6.0"
|
15
17
|
end
|
data/test/context_test.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'minitest/autorun'
|
3
3
|
require_relative '../lib/minitest-spec-context'
|
4
|
+
require 'active_support'
|
5
|
+
require 'active_support/test_case'
|
4
6
|
|
5
7
|
describe MiniTest::Spec do
|
6
8
|
describe ".context" do
|
@@ -12,3 +14,14 @@ describe MiniTest::Spec do
|
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
17
|
+
|
18
|
+
class ActiveSupport::TestCase
|
19
|
+
describe ".context" do
|
20
|
+
let(:object) { "44" }
|
21
|
+
context "when nested with context method" do
|
22
|
+
it "has the access to the variables defined outside" do
|
23
|
+
object.must_equal "44"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,16 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-spec-context
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Yi Wen
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
11
|
+
date: 2019-09-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '6.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '6.0'
|
14
27
|
description: Provides context method to MiniTest::Spec
|
15
28
|
email:
|
16
29
|
- hayafirst@gmail.com
|
@@ -18,7 +31,7 @@ executables: []
|
|
18
31
|
extensions: []
|
19
32
|
extra_rdoc_files: []
|
20
33
|
files:
|
21
|
-
- .gitignore
|
34
|
+
- ".gitignore"
|
22
35
|
- Gemfile
|
23
36
|
- LICENSE
|
24
37
|
- README.md
|
@@ -29,27 +42,25 @@ files:
|
|
29
42
|
- test/context_test.rb
|
30
43
|
homepage: https://github.com/ywen/minitest-spec-context
|
31
44
|
licenses: []
|
45
|
+
metadata: {}
|
32
46
|
post_install_message:
|
33
47
|
rdoc_options: []
|
34
48
|
require_paths:
|
35
49
|
- lib
|
36
50
|
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
-
none: false
|
38
51
|
requirements:
|
39
|
-
- -
|
52
|
+
- - ">="
|
40
53
|
- !ruby/object:Gem::Version
|
41
54
|
version: '0'
|
42
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
-
none: false
|
44
56
|
requirements:
|
45
|
-
- -
|
57
|
+
- - ">="
|
46
58
|
- !ruby/object:Gem::Version
|
47
59
|
version: '0'
|
48
60
|
requirements: []
|
49
|
-
|
50
|
-
rubygems_version: 1.8.21
|
61
|
+
rubygems_version: 3.0.3
|
51
62
|
signing_key:
|
52
|
-
specification_version:
|
63
|
+
specification_version: 4
|
53
64
|
summary: Provides context method to MiniTest::Spec
|
54
65
|
test_files:
|
55
66
|
- test/context_test.rb
|