minitest-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: aa21ad961fcb26d8049ba62734d6026114d9f3f4
4
- data.tar.gz: 3e082bc1ec7468b205c204384315c7da845fa03c
3
+ metadata.gz: 39a78e633e738fbce67c2563b5fae535ec81b4f7
4
+ data.tar.gz: 5b0485aae6e42d5df7e6d3f6306d8f5c3e93700c
5
5
  SHA512:
6
- metadata.gz: 6819cb252f5bd2a2cefa76e931958f200964db3e799096ed71ee07a5e5eec54e337536de5b4aec86eacdd9cd8cd033d739ab7813daeb83c7e56c2d3591532baa
7
- data.tar.gz: bb328c179e705ff0a9f5aa53aee0be38087503cd65ae11a246c6a99bbdf8a2578d538d376a2b327aa653fc5892bc40f217b247da69bc6e0b908b6789c5bd626d
6
+ metadata.gz: 45d5123c6470195a71154f48dc8226f2f655e69add11c20a5d775d64471c1a268ab619afa632d0e17eef7cdd4841bbd940cab71227c76e373be75f54e7a04fd8
7
+ data.tar.gz: 569c233f21a5c3a195963f79e95839fad5e8ae98e298770ace4212c188b85dd8b4a70ad22c4dd1f569243b6dd79b59f991bea0cfd7ac49c9cf7cdf981905c38e
@@ -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
@@ -1,15 +1,2 @@
1
1
  require 'minitest/spec'
2
-
3
- if defined?(ActiveSupport::TestCase)
4
- Minitest::Spec.tap do |original_spec|
5
- Minitest.send(:remove_const, :Spec)
6
- Minitest::Spec = ActiveSupport::TestCase
7
-
8
- require 'given/minitest/all'
9
-
10
- Minitest.send(:remove_const, :Spec)
11
- Minitest::Spec = original_spec
12
- end
13
- else
14
- require 'given/minitest/all'
15
- end
2
+ require 'given/minitest/all'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-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: minitest
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
@@ -109,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
111
  version: '0'
110
112
  requirements: []
111
113
  rubyforge_project: given
112
- rubygems_version: 2.4.4
114
+ rubygems_version: 2.2.3
113
115
  signing_key:
114
116
  specification_version: 4
115
117
  summary: Given/When/Then Specification Extensions for Minitest::Spec.