rspec-given 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # rspec-given
2
2
 
3
- Covering rspec-given, version 2.1.0.
3
+ Covering rspec-given, version 2.2.0.
4
4
 
5
5
  rspec-given is an RSpec extension to allow Given/When/Then notation in
6
6
  RSpec specifications. It is a natural extension of the experimental
@@ -9,12 +9,20 @@ module RSpec
9
9
  # implementation-specific.
10
10
  module InstanceExtensions # :nodoc:
11
11
 
12
+ # List of containing contexts in order from outermost to
13
+ # innermost.
14
+ def _rg_contexts # :nodoc:
15
+ self.class.ancestors.select { |context|
16
+ context.respond_to?(:_rg_givens)
17
+ }.reverse
18
+ end
19
+
12
20
  # Establish all the Given preconditions the current and
13
21
  # surrounding describe/context blocks, starting with the
14
22
  # outermost context.
15
23
  def _rg_establish_givens # :nodoc:
16
24
  return if defined?(@_rg_ran)
17
- self.class.ancestors.reverse.each do |context|
25
+ _rg_contexts.each do |context|
18
26
  context._rg_givens.each do |block|
19
27
  instance_eval(&block)
20
28
  end
@@ -25,7 +33,7 @@ module RSpec
25
33
  # Check all the invariants in the current and surrounding
26
34
  # describe/context blocks, starting with the outermost context.
27
35
  def _rg_check_invariants # :nodoc:
28
- self.class.ancestors.reverse.each do |context|
36
+ _rg_contexts.each do |context|
29
37
  context._rg_invariants.each do |block|
30
38
  instance_eval(&block)
31
39
  end
@@ -2,7 +2,7 @@ module RSpec
2
2
  module Given
3
3
  VERSION_NUMBERS = [
4
4
  VERSION_MAJOR = 2,
5
- VERSION_MINOR = 1,
5
+ VERSION_MINOR = 2,
6
6
  VERSION_BUILD = 0,
7
7
  ]
8
8
  VERSION = VERSION_NUMBERS.join(".")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-given
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-22 00:00:00.000000000 Z
12
+ date: 2012-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -72,9 +72,10 @@ files:
72
72
  - Gemfile
73
73
  - Gemfile.lock
74
74
  - MIT-LICENSE
75
- - Rakefile
76
75
  - README.md
76
+ - Rakefile
77
77
  - lib/rspec-given.rb
78
+ - lib/rspec/given.rb
78
79
  - lib/rspec/given/configure.rb
79
80
  - lib/rspec/given/extensions.rb
80
81
  - lib/rspec/given/failure.rb
@@ -84,7 +85,6 @@ files:
84
85
  - lib/rspec/given/module_methods.rb
85
86
  - lib/rspec/given/rspec1_given.rb
86
87
  - lib/rspec/given/version.rb
87
- - lib/rspec/given.rb
88
88
  - examples/example_helper.rb
89
89
  - examples/integration/and_spec.rb
90
90
  - examples/integration/focused_line_spec.rb
@@ -112,9 +112,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
112
  - - ! '>='
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
- segments:
116
- - 0
117
- hash: -836562108368916480
118
115
  required_rubygems_version: !ruby/object:Gem::Requirement
119
116
  none: false
120
117
  requirements: