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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94237753a606000757dbb437f8396e0db9db1d65
4
- data.tar.gz: 13558aa721a41d6c24501fb82cee649446616b0c
3
+ metadata.gz: 14d0de198be7793a1eba3670e46518ba7d9de736
4
+ data.tar.gz: 9619a055a17cecbc3709598469e5d1bbc2d958a6
5
5
  SHA512:
6
- metadata.gz: 38b78012459e188924b6638a127c2df4767b8a9b7c42db94cf1058a52b901d511ad6b27863f7f7b7a45a71ec021982deeb5dac8f464a927e0f17090a67930d7a
7
- data.tar.gz: 24b3dee10a329af6a5ee7dbc609638484225b95cfb49b74c35ba4d5b9d86da3fb39dc32638e0f8cf047eb0545832616a8078be81da64b5266c48be6cef623cad
6
+ metadata.gz: 407535da7a864a68299417569f2d928c47b59c1de753efbd50cb09f3e026feb5b631911cbc605044b2ee70bb136b777f86022df0d1a5ee757fde5316ea475fdd
7
+ data.tar.gz: 220105bfddd1b6e413509f72c30846f370296e70fe137244abbb688dbd9a2eec8b97444de13e91ddf7c64d06080fad2c148ba61a36db4705ab50270fdefe48d6
@@ -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.0)
5
+ minitest (5.7.0)
6
6
  rake (10.4.2)
7
- rspec (3.1.0)
8
- rspec-core (~> 3.1.0)
9
- rspec-expectations (~> 3.1.0)
10
- rspec-mocks (~> 3.1.0)
11
- rspec-core (3.1.7)
12
- rspec-support (~> 3.1.0)
13
- rspec-expectations (3.1.2)
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.1.0)
16
- rspec-mocks (3.1.3)
17
- rspec-support (~> 3.1.0)
18
- rspec-support (3.1.2)
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")
@@ -0,0 +1,10 @@
1
+ module ActiveSupport
2
+ class TestCase < Minitest::Test
3
+ # Add spec DSL
4
+ extend ::Minitest::Spec::DSL
5
+
6
+ register_spec_type(self) do |desc, *addl|
7
+ addl.include? :model
8
+ end
9
+ end
10
+ end
@@ -5,6 +5,7 @@ if defined?(RSpec)
5
5
  require 'spec_helper'
6
6
  else
7
7
  require 'minitest/autorun'
8
+ require 'active_support_helper'
8
9
  require 'minitest/given'
9
10
  require 'minitest_helper'
10
11
  end
@@ -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 =~ /undefined local variable or method `xyz'/ }
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
@@ -55,8 +55,8 @@ describe "Lazy Givens" do
55
55
  end
56
56
 
57
57
  context "when not called" do
58
- Given(:value) { :ok }
59
- Then { given_assert_equal :ok, value }
58
+ Given(:some_value) { :ok }
59
+ Then { given_assert_equal :ok, some_value }
60
60
  end
61
61
  end
62
62
 
@@ -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
+
@@ -35,4 +35,5 @@ module NaturalAssertionControl
35
35
  end
36
36
 
37
37
  Minitest::Spec.send(:include, GivenAssertions)
38
+ Minitest::Test.send(:include, GivenAssertions)
38
39
  include NaturalAssertionControl
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.0
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-02-15 00:00:00.000000000 Z
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.0
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.0
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.4.4
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.