rspec-given 2.0.0.beta.2 → 2.0.0.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/examples/integration/focused_line_spec.rb +8 -0
- data/examples/other/line_example.rb +9 -0
- data/lib/rspec/given/extensions.rb +11 -5
- data/lib/rspec/given/version.rb +1 -1
- metadata +10 -8
data/README.md
CHANGED
@@ -30,6 +30,13 @@ module RSpec
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
33
|
+
|
34
|
+
# Implement the run-time semantics of the Then clause.
|
35
|
+
def _rg_then(&block) # :nodoc:
|
36
|
+
_rg_establish_givens
|
37
|
+
_rg_check_invariants
|
38
|
+
instance_eval(&block)
|
39
|
+
end
|
33
40
|
end
|
34
41
|
|
35
42
|
module ClassExtensions
|
@@ -134,11 +141,10 @@ module RSpec
|
|
134
141
|
# Given and When blocks have been run. All invariants in scope
|
135
142
|
# will be checked before the Then block is run.
|
136
143
|
def Then(&block)
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
end
|
144
|
+
b = block.binding
|
145
|
+
file = eval "__FILE__", b
|
146
|
+
line = eval "__LINE__", b
|
147
|
+
eval %{specify do _rg_then(&block) end}, binding, file, line
|
142
148
|
end
|
143
149
|
|
144
150
|
# Establish an invariant that must be true for all Then blocks
|
data/lib/rspec/given/version.rb
CHANGED
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.0.0.beta.
|
4
|
+
version: 2.0.0.beta.3
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70142348610120 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>'
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.2.8
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70142348610120
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bluecloth
|
27
|
-
requirement: &
|
27
|
+
requirement: &70142348626080 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70142348626080
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rdoc
|
38
|
-
requirement: &
|
38
|
+
requirement: &70142348625560 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>'
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: 2.4.2
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70142348625560
|
47
47
|
description: ! 'Given is an RSpec extension that allows explicit definition of the
|
48
48
|
|
49
49
|
pre and post-conditions for code under test.
|
@@ -67,8 +67,10 @@ files:
|
|
67
67
|
- lib/rspec/given/rspec1_given.rb
|
68
68
|
- lib/rspec/given/version.rb
|
69
69
|
- lib/rspec/given.rb
|
70
|
+
- examples/integration/focused_line_spec.rb
|
70
71
|
- examples/integration/given_spec.rb
|
71
72
|
- examples/integration/invariant_spec.rb
|
73
|
+
- examples/other/line_example.rb
|
72
74
|
- examples/spec_helper.rb
|
73
75
|
- examples/stack/stack.rb
|
74
76
|
- examples/stack/stack_spec.rb
|