given_core 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: db146072a54f5bf42a438ce356c7477854fbbf21
4
- data.tar.gz: 7ac0794179cea778caff7ba4ac200765edd67833
3
+ metadata.gz: 82c044841ee9503defff72cc88d40b500327dec0
4
+ data.tar.gz: 7d91a83e5740375f068fa55b917cf60549482026
5
5
  SHA512:
6
- metadata.gz: ad4189dac1d901400c352a0582ae128e2a7be2d10a35887952ee9073bc3fc194ae82212b8e1c00e25c4c7ed0ad60d7028dc4b6d8357282494fb9f15278cc8503
7
- data.tar.gz: 863c661490de0c6b0e4018e1fb012336d0a2db314b03c60c2fa7c448794ba5183a792e312e8c9639e6ba839b5a139c43fdf80b5a1f54d517f2922cf3c4725912
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.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")
@@ -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
- # Establish the before blocks
16
- def _gvn_establish_befores
17
- return if defined?(@_gvn_ran_befores) && @_gvn_ran_befores
18
- @_gvn_ran_befores = true
19
- _gvn_contexts.each do |context|
20
- context._Gvn_before_blocks.each do |before_block|
21
- instance_eval(&before_block)
22
- end
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
@@ -3,7 +3,7 @@ module Given
3
3
  VERSION_NUMBERS = [
4
4
  VERSION_MAJOR = 3,
5
5
  VERSION_MINOR = 7,
6
- VERSION_BUILD = 0,
6
+ VERSION_BUILD = 1,
7
7
  ]
8
8
  VERSION = VERSION_NUMBERS.join(".")
9
9
  end
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.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: 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.4.4
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.