always_execute 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/always_execute/rspec_execute.rb +6 -4
- data/lib/always_execute/version.rb +1 -1
- data/spec/execute_spec.rb +17 -9
- metadata +17 -29
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3a00e8009a9d6f036bfd27245be285d3985985cf
|
4
|
+
data.tar.gz: 4fcce697242148911f555789f0f1ed5953fd9c1b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 185dfb63e4f6d0f5e53f3345008ce4411db5bf01103934fad58ddfc422061cca815f549d14663626c275eaa2744c0b7da5edd92fb007ea244c0350702536a682
|
7
|
+
data.tar.gz: e27f2f2474967b8a06d94788b3a76795005ad95894c4916d052da4aba6c976a564f68b212865cf18feee279f1b61c993ce66fb5abb8b32473bb6fceac547c5b1
|
@@ -2,7 +2,7 @@ module RSpec
|
|
2
2
|
module Core
|
3
3
|
class Example
|
4
4
|
alias :initialize_without_execute :initialize
|
5
|
-
|
5
|
+
|
6
6
|
def initialize(example_group_class, description, metadata, example_block=nil)
|
7
7
|
if example_block
|
8
8
|
example_block_with_execute = Proc.new do |*args|
|
@@ -12,16 +12,18 @@ module RSpec
|
|
12
12
|
instance_exec(*args, &example_block)
|
13
13
|
end
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
initialize_without_execute(example_group_class, description, metadata, example_block_with_execute)
|
17
17
|
end
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
class ExampleGroup
|
21
|
-
def self.execute(&execute_block)
|
21
|
+
def self.execute(result_name=:execute_result, &execute_block)
|
22
22
|
before do
|
23
23
|
@execute_block = execute_block
|
24
24
|
end
|
25
|
+
|
26
|
+
let(result_name) { @execute_result }
|
25
27
|
end
|
26
28
|
end
|
27
29
|
end
|
data/spec/execute_spec.rb
CHANGED
@@ -5,38 +5,46 @@ describe ".execute" do
|
|
5
5
|
execute do
|
6
6
|
:success
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
it "should set execute_result to execute block return value" do
|
10
|
-
:success.should ==
|
10
|
+
:success.should == execute_result
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context "with execute_result_name" do
|
15
|
+
execute(:the_result) { :result_value }
|
16
|
+
|
17
|
+
it "stores execute result in variable with execute_result_name" do
|
18
|
+
the_result.should == :result_value
|
11
19
|
end
|
12
20
|
end
|
13
|
-
|
21
|
+
|
14
22
|
context "execute in nested contexts" do
|
15
23
|
before do
|
16
24
|
@last_step = :before_level1
|
17
25
|
end
|
18
|
-
|
26
|
+
|
19
27
|
execute do
|
20
28
|
:before_level1.should == @last_step
|
21
29
|
@last_step = :execute_level1
|
22
30
|
end
|
23
|
-
|
31
|
+
|
24
32
|
it "should execute execute_level1" do
|
25
33
|
@last_step.should == :execute_level1
|
26
34
|
end
|
27
|
-
|
35
|
+
|
28
36
|
context "with nested context with no execute" do
|
29
37
|
it "should execute execute_level1" do
|
30
38
|
@last_step.should == :execute_level1
|
31
39
|
end
|
32
40
|
end
|
33
|
-
|
41
|
+
|
34
42
|
context "with nested context with execute override" do
|
35
43
|
before do
|
36
44
|
:before_level1.should == @last_step
|
37
45
|
@last_step = :before_level2
|
38
46
|
end
|
39
|
-
|
47
|
+
|
40
48
|
execute do
|
41
49
|
:before_level2.should == @last_step
|
42
50
|
@last_step = :execute_level2
|
@@ -47,4 +55,4 @@ describe ".execute" do
|
|
47
55
|
end
|
48
56
|
end
|
49
57
|
end
|
50
|
-
end
|
58
|
+
end
|
metadata
CHANGED
@@ -1,36 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: always_execute
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Michael Pearce
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-10-31 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rspec
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 2.9.0
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 2.9.0
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: shoulda
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - '='
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - '='
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,49 +41,43 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: mocha
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: minitest
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- - ~>
|
59
|
+
- - "~>"
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: 2.12.1
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- - ~>
|
66
|
+
- - "~>"
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: 2.12.1
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: shared_should
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- - ~>
|
73
|
+
- - "~>"
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: 0.9.0
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- - ~>
|
80
|
+
- - "~>"
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: 0.9.0
|
94
83
|
description: Adds execute and expect test blocks for added BDD test clarity.
|
@@ -98,8 +87,8 @@ executables: []
|
|
98
87
|
extensions: []
|
99
88
|
extra_rdoc_files: []
|
100
89
|
files:
|
101
|
-
- .document
|
102
|
-
- .gitignore
|
90
|
+
- ".document"
|
91
|
+
- ".gitignore"
|
103
92
|
- Gemfile
|
104
93
|
- Gemfile.lock
|
105
94
|
- LICENSE.txt
|
@@ -122,27 +111,26 @@ files:
|
|
122
111
|
- test/shoulda_expects_test.rb
|
123
112
|
homepage: http://github.com/michaelgpearce/always_execute
|
124
113
|
licenses: []
|
114
|
+
metadata: {}
|
125
115
|
post_install_message:
|
126
116
|
rdoc_options: []
|
127
117
|
require_paths:
|
128
118
|
- lib
|
129
119
|
required_ruby_version: !ruby/object:Gem::Requirement
|
130
|
-
none: false
|
131
120
|
requirements:
|
132
|
-
- -
|
121
|
+
- - ">="
|
133
122
|
- !ruby/object:Gem::Version
|
134
123
|
version: '0'
|
135
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
|
-
none: false
|
137
125
|
requirements:
|
138
|
-
- -
|
126
|
+
- - ">="
|
139
127
|
- !ruby/object:Gem::Version
|
140
128
|
version: '0'
|
141
129
|
requirements: []
|
142
130
|
rubyforge_project: always_execute
|
143
|
-
rubygems_version:
|
131
|
+
rubygems_version: 2.2.2
|
144
132
|
signing_key:
|
145
|
-
specification_version:
|
133
|
+
specification_version: 4
|
146
134
|
summary: Adds execute and expect test blocks for added BDD test clarity
|
147
135
|
test_files:
|
148
136
|
- spec/execute_spec.rb
|