rspec-given 3.7.0 → 3.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +13 -13
- data/README.md +4 -0
- data/Rakefile +2 -1
- data/examples/active_support_helper.rb +10 -0
- data/examples/example_helper.rb +1 -0
- data/examples/integration/failing_messages_spec.rb +10 -1
- data/examples/integration/given_spec.rb +2 -2
- data/examples/minitest-rails/test_case_spec.rb +33 -0
- data/examples/minitest_helper.rb +1 -0
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14d0de198be7793a1eba3670e46518ba7d9de736
|
4
|
+
data.tar.gz: 9619a055a17cecbc3709598469e5d1bbc2d958a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 407535da7a864a68299417569f2d928c47b59c1de753efbd50cb09f3e026feb5b631911cbc605044b2ee70bb136b777f86022df0d1a5ee757fde5316ea475fdd
|
7
|
+
data.tar.gz: 220105bfddd1b6e413509f72c30846f370296e70fe137244abbb688dbd9a2eec8b97444de13e91ddf7c64d06080fad2c148ba61a36db4705ab50270fdefe48d6
|
data/Gemfile.lock
CHANGED
@@ -2,24 +2,24 @@ GEM
|
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
4
|
diff-lcs (1.2.5)
|
5
|
-
minitest (5.
|
5
|
+
minitest (5.7.0)
|
6
6
|
rake (10.4.2)
|
7
|
-
rspec (3.
|
8
|
-
rspec-core (~> 3.
|
9
|
-
rspec-expectations (~> 3.
|
10
|
-
rspec-mocks (~> 3.
|
11
|
-
rspec-core (3.1
|
12
|
-
rspec-support (~> 3.
|
13
|
-
rspec-expectations (3.
|
7
|
+
rspec (3.3.0)
|
8
|
+
rspec-core (~> 3.3.0)
|
9
|
+
rspec-expectations (~> 3.3.0)
|
10
|
+
rspec-mocks (~> 3.3.0)
|
11
|
+
rspec-core (3.3.1)
|
12
|
+
rspec-support (~> 3.3.0)
|
13
|
+
rspec-expectations (3.3.0)
|
14
14
|
diff-lcs (>= 1.2.0, < 2.0)
|
15
|
-
rspec-support (~> 3.
|
16
|
-
rspec-mocks (3.1
|
17
|
-
|
18
|
-
|
15
|
+
rspec-support (~> 3.3.0)
|
16
|
+
rspec-mocks (3.3.1)
|
17
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
18
|
+
rspec-support (~> 3.3.0)
|
19
|
+
rspec-support (3.3.0)
|
19
20
|
sorcerer (1.0.2)
|
20
21
|
|
21
22
|
PLATFORMS
|
22
|
-
java
|
23
23
|
ruby
|
24
24
|
|
25
25
|
DEPENDENCIES
|
data/README.md
CHANGED
@@ -870,6 +870,10 @@ License. See the MIT-LICENSE file in the source distribution.
|
|
870
870
|
|
871
871
|
# History
|
872
872
|
|
873
|
+
* Version 3.7.1
|
874
|
+
|
875
|
+
* Mixin Minitest extensions for both ActiveSupport::TestCase (when present) as well as for MiniTest::Spec (see [#8](https://github.com/rspec-given/rspec-given/pulls/8))
|
876
|
+
|
873
877
|
* Version 3.7.0
|
874
878
|
|
875
879
|
* Add support for Rails tests when using minitest-given (See [#6](https://github.com/rspec-given/rspec-given/pull/6))
|
data/Rakefile
CHANGED
@@ -62,9 +62,10 @@ end
|
|
62
62
|
EXAMPLES = FileList['examples/**/*_spec.rb', 'examples/use_assertions.rb'].
|
63
63
|
exclude('examples/failing/*.rb').
|
64
64
|
exclude('examples/minitest/*.rb').
|
65
|
+
exclude('examples/minitest-rails/*.rb').
|
65
66
|
exclude('examples/integration/failing/*.rb')
|
66
67
|
|
67
|
-
MT_EXAMPLES = FileList['examples/minitest/**/*_spec.rb']
|
68
|
+
MT_EXAMPLES = FileList['examples/minitest-rails/**/*_spec.rb', 'examples/minitest/**/*_spec.rb']
|
68
69
|
|
69
70
|
unless Given::NATURAL_ASSERTIONS_SUPPORTED
|
70
71
|
EXAMPLES.exclude("examples/stack/*.rb")
|
data/examples/example_helper.rb
CHANGED
@@ -22,7 +22,16 @@ describe "Failing Messages" do
|
|
22
22
|
context "when referencing undefined methods" do
|
23
23
|
Given(:failing_test) { "undefined_method_spec.rb" }
|
24
24
|
Then { ios.err == "" }
|
25
|
-
And { ios.out
|
25
|
+
And { complains_xyz_is_not_in_scope?(ios.out) }
|
26
|
+
|
27
|
+
def complains_xyz_is_not_in_scope?(out)
|
28
|
+
[
|
29
|
+
# RSpec <3.2's message:
|
30
|
+
"undefined local variable or method `xyz'",
|
31
|
+
# RSpec >3.2's message:
|
32
|
+
"`xyz` is not available from within an example"
|
33
|
+
].any? { |msg| out.include?(msg) }
|
34
|
+
end
|
26
35
|
end
|
27
36
|
|
28
37
|
context "when breaking down expressions" do
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'active_support_helper'
|
3
|
+
require 'minitest/given'
|
4
|
+
require 'example_helper'
|
5
|
+
|
6
|
+
|
7
|
+
describe ActiveSupport::TestCase, :model do
|
8
|
+
Given(:info) { [] }
|
9
|
+
Given { info << "outer1" }
|
10
|
+
Given { info << "outer2" }
|
11
|
+
|
12
|
+
context "using a when without result" do
|
13
|
+
When { info << "when" }
|
14
|
+
|
15
|
+
context "inner with When" do
|
16
|
+
Given { info << "inner1" }
|
17
|
+
Given { info << "inner2" }
|
18
|
+
Then { given_assert_equal ["outer1", "outer2", "inner1", "inner2", "when"], info }
|
19
|
+
|
20
|
+
context "using a nested When" do
|
21
|
+
When { info << "when2" }
|
22
|
+
Then { given_assert_equal ["outer1", "outer2", "inner1", "inner2", "when", "when2"], info}
|
23
|
+
end
|
24
|
+
|
25
|
+
context "using two nested When" do
|
26
|
+
When { info << "when2a" }
|
27
|
+
When { info << "when2b" }
|
28
|
+
Then { given_assert_equal ["outer1", "outer2", "inner1", "inner2", "when", "when2a", "when2b"], info }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
data/examples/minitest_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-given
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.7.
|
4
|
+
version: 3.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Weirich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: given_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.7.
|
19
|
+
version: 3.7.1
|
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: 3.7.
|
26
|
+
version: 3.7.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -54,6 +54,7 @@ files:
|
|
54
54
|
- TODO
|
55
55
|
- doc/article/custom_error_messages.md
|
56
56
|
- doc/main.rdoc
|
57
|
+
- examples/active_support_helper.rb
|
57
58
|
- examples/example_helper.rb
|
58
59
|
- examples/failing/natural_failing_spec.rb
|
59
60
|
- examples/failing/sample_spec.rb
|
@@ -69,6 +70,7 @@ files:
|
|
69
70
|
- examples/integration/invariant_spec.rb
|
70
71
|
- examples/integration/then_spec.rb
|
71
72
|
- examples/loader.rb
|
73
|
+
- examples/minitest-rails/test_case_spec.rb
|
72
74
|
- examples/minitest/assert_raises_spec.rb
|
73
75
|
- examples/minitest_helper.rb
|
74
76
|
- examples/other/line_example.rb
|
@@ -131,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
133
|
version: '0'
|
132
134
|
requirements: []
|
133
135
|
rubyforge_project: given
|
134
|
-
rubygems_version: 2.
|
136
|
+
rubygems_version: 2.2.3
|
135
137
|
signing_key:
|
136
138
|
specification_version: 4
|
137
139
|
summary: Given/When/Then Specification Extensions for RSpec.
|