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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # rspec-given
2
2
 
3
- Covering rspec-given, version 2.0.0.beta.2.
3
+ Covering rspec-given, version 2.0.0.beta.3.
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
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Focused Line" do
4
+ it "runs only a single test" do
5
+ output = `rspec examples/other/line_example.rb:7`
6
+ output.should_not =~ /FIRST/
7
+ end
8
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Line Spec" do
4
+
5
+ Then { puts "FIRST" }
6
+
7
+ Then { puts "SECOND" }
8
+
9
+ end
@@ -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
- specify do
138
- _rg_establish_givens
139
- _rg_check_invariants
140
- instance_eval(&block)
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
@@ -5,7 +5,7 @@ module RSpec
5
5
  VERSION_MINOR = 0,
6
6
  VERSION_BUILD = 0,
7
7
  VERSION_BETA = 'beta',
8
- VERSION_BETANUM = 2,
8
+ VERSION_BETANUM = 3,
9
9
  ]
10
10
  VERSION = VERSION_NUMBERS.join(".")
11
11
  end
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.2
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-04 00:00:00.000000000 Z
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: &70238859403780 !ruby/object:Gem::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: *70238859403780
24
+ version_requirements: *70142348610120
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bluecloth
27
- requirement: &70238859403340 !ruby/object:Gem::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: *70238859403340
35
+ version_requirements: *70142348626080
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rdoc
38
- requirement: &70238859402720 !ruby/object:Gem::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: *70238859402720
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