rspec_in_context 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/lib/rspec_in_context/in_context.rb +1 -0
- data/lib/rspec_in_context/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5642e59dbebb5dbff148e8ae509607566bc308da
|
4
|
+
data.tar.gz: 9be37738f258a437096c8f7d96eff8d38f26c23e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db08c47163993a7bfb142d3339ad4e1915f249f139216a346bf5c472466288a0fed029c624723a183053868a91720edc682d1c48acd70bce3582e9240b7e0a41
|
7
|
+
data.tar.gz: f771413d8739af72f3acbe88a2ff2ae6b75458fc6137d2f96836bf78f92f33c95df68f8bb00df9f119d7a8556023a9b6e151e02896fa6bb4fc10a44b6e38caa6
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# RspecInContext
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/rspec_in_context.svg)](https://badge.fury.io/rb/rspec_in_context)
|
4
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/7ee82740e840412b864574851aa44f16)](https://www.codacy.com/project/denis-pasin/rspec_in_context/dashboard?utm_source=github.com&utm_medium=referral&utm_content=denispasin/rspec_in_context&utm_campaign=Badge_Grade_Dashboard)
|
5
|
+
|
6
|
+
|
3
7
|
This gem is here to help you write better shared_examples in Rspec.
|
4
8
|
|
5
9
|
Ever been bothered by the fact that they don't really behave like methods and that you can't pass it a block ? There you go: `rspec_in_context`
|
@@ -58,7 +62,7 @@ end
|
|
58
62
|
|
59
63
|
##### Outside a Rspec block
|
60
64
|
|
61
|
-
Outside of a test you have to use `
|
65
|
+
Outside of a test you have to use `RSpec.define_context`.
|
62
66
|
|
63
67
|
|
64
68
|
### Use the context
|
@@ -105,6 +109,9 @@ in_context :context_name do
|
|
105
109
|
end
|
106
110
|
```
|
107
111
|
|
112
|
+
* You can add variable instantiation relative to your test where you exactly want
|
113
|
+
It's an alias of `execute_tests` so you can't use both. But it let you describe what the block will do better.
|
114
|
+
|
108
115
|
* You can use variable in the in_context definition
|
109
116
|
|
110
117
|
```ruby
|
@@ -33,6 +33,7 @@ module RspecInContext
|
|
33
33
|
def execute_tests
|
34
34
|
instance_exec(&Thread.current[:test_block]) if Thread.current[:test_block]
|
35
35
|
end
|
36
|
+
alias_method :instanciate_context, :execute_tests
|
36
37
|
|
37
38
|
def define_context(context_name, &block)
|
38
39
|
InContext.add_context(context_name, &block)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_in_context
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis <Zaratan> Pasin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
193
|
version: '0'
|
194
194
|
requirements: []
|
195
195
|
rubyforge_project:
|
196
|
-
rubygems_version: 2.
|
196
|
+
rubygems_version: 2.5.2.3
|
197
197
|
signing_key:
|
198
198
|
specification_version: 4
|
199
199
|
summary: This gem is here to help DRYing your tests cases by giving a better "shared_examples".
|