given_core 3.7.0 → 3.7.1
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 +4 -4
- data/Gemfile.lock +13 -13
- data/README.md +4 -0
- data/Rakefile +2 -1
- data/lib/given/minitest/before_extension.rb +39 -19
- data/lib/given/minitest/configure.rb +10 -2
- data/lib/given/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: 82c044841ee9503defff72cc88d40b500327dec0
|
4
|
+
data.tar.gz: 7d91a83e5740375f068fa55b917cf60549482026
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e244317ee8961885303bd63ab43d86c04eeb92b3d0bf4f60f81c1721f87481fc522a924e07b7d4c6d3534012168dc849974c4bc5833f2fd86bddd2a04885ed5f
|
7
|
+
data.tar.gz: 337ab49896640b4099737d50126cbda6f096d5049034cf2083dd7f662bb1915ab3a33c9b16031911885b94ce17c3a6786a00ddba823fdde5890e556c8cd70b9d
|
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")
|
@@ -2,35 +2,55 @@
|
|
2
2
|
# The before blocks defined in Minitest are inadequate for our use.
|
3
3
|
# This before_extension file allows us to use real before blocks.
|
4
4
|
|
5
|
+
module Given
|
6
|
+
module MiniTest
|
7
|
+
module ClassExtensions
|
8
|
+
# Lazy accessor for Given's before blocks
|
9
|
+
def _Gvn_before_blocks
|
10
|
+
@_Gvn_before_blocks ||= []
|
11
|
+
end
|
12
|
+
|
13
|
+
# Define a Given style before block
|
14
|
+
def _Gvn_before(&block)
|
15
|
+
_Gvn_before_blocks << block
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
module InstanceExtensions
|
20
|
+
# Establish the before blocks
|
21
|
+
def _gvn_establish_befores
|
22
|
+
return if defined?(@_gvn_ran_befores) && @_gvn_ran_befores
|
23
|
+
@_gvn_ran_befores = true
|
24
|
+
_gvn_contexts.each do |context|
|
25
|
+
context._Gvn_before_blocks.each do |before_block|
|
26
|
+
instance_eval(&before_block)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
5
34
|
module Minitest
|
6
35
|
class Spec
|
7
|
-
|
8
36
|
# Redefine setup to trigger before chains
|
9
37
|
alias original_setup_without_given setup
|
10
38
|
def setup
|
11
39
|
original_setup_without_given
|
12
40
|
_gvn_establish_befores
|
13
41
|
end
|
42
|
+
end
|
43
|
+
end
|
14
44
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
45
|
+
if defined?(ActiveSupport::TestCase)
|
46
|
+
module ActiveSupport
|
47
|
+
class TestCase
|
48
|
+
# Redefine setup to trigger before chains
|
49
|
+
alias original_setup_without_given setup
|
50
|
+
def setup
|
51
|
+
original_setup_without_given
|
52
|
+
_gvn_establish_befores
|
23
53
|
end
|
24
54
|
end
|
25
|
-
|
26
|
-
# Lazy accessor for Given's before blocks
|
27
|
-
def self._Gvn_before_blocks
|
28
|
-
@_Gvn_before_blocks ||= []
|
29
|
-
end
|
30
|
-
|
31
|
-
# Define a Given style before block
|
32
|
-
def self._Gvn_before(&block)
|
33
|
-
_Gvn_before_blocks << block
|
34
|
-
end
|
35
55
|
end
|
36
56
|
end
|
@@ -1,7 +1,15 @@
|
|
1
|
-
|
1
|
+
# Configure ActiveSupprt::TestCase to use the Given extensions.
|
2
|
+
if defined?(ActiveSupport::TestCase)
|
3
|
+
ActiveSupport::TestCase.send(:extend, Given::ClassExtensions)
|
4
|
+
ActiveSupport::TestCase.send(:extend, Given::MiniTest::ClassExtensions)
|
5
|
+
ActiveSupport::TestCase.send(:include, Given::FailureMethod)
|
6
|
+
ActiveSupport::TestCase.send(:include, Given::InstanceExtensions)
|
7
|
+
ActiveSupport::TestCase.send(:include, Given::MiniTest::InstanceExtensions)
|
8
|
+
end
|
2
9
|
# Configure Minitest to use the Given extensions.
|
3
|
-
|
4
10
|
Minitest::Spec.send(:extend, Given::ClassExtensions)
|
11
|
+
Minitest::Spec.send(:extend, Given::MiniTest::ClassExtensions)
|
5
12
|
Minitest::Spec.send(:include, Given::FailureMethod)
|
6
13
|
Minitest::Spec.send(:include, Given::InstanceExtensions)
|
14
|
+
Minitest::Spec.send(:include, Given::MiniTest::InstanceExtensions)
|
7
15
|
Given.use_natural_assertions if Given::NATURAL_ASSERTIONS_SUPPORTED
|
data/lib/given/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: given_core
|
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: sorcerer
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
requirements: []
|
105
105
|
rubyforge_project: given
|
106
|
-
rubygems_version: 2.
|
106
|
+
rubygems_version: 2.2.3
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Core engine for RSpec::Given and Minitest::Given.
|