specify 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/specify/rspec/example_group.rb +0 -8
- data/lib/specify/spec.rb +29 -3
- data/lib/specify/version.rb +1 -1
- data/lib/specify.rb +3 -3
- data/spec/nested_spec.rb +70 -0
- data/spec/pending_spec.rb +12 -0
- data/spec/steps_spec.rb +35 -45
- data/spec/top_level_spec.rb +25 -0
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a168d4a8b7345ed5b16cd6c43da66c2363de56d
|
4
|
+
data.tar.gz: 530ed45e4c88fd822a26f044ee568d93ab93a0a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f48361f4930baad91b7f785bc8e72b29587b46471a723d9f5ba4013c111804f446f3c3c82a8d74f6788b9d7bcc9672298d721586930052aa9d6cd341743eb6ca
|
7
|
+
data.tar.gz: e342c95bcb8702f9a3edec0325713f418a0522ab53402bb31003e99bf60f1d50a314c254d4dc60985ce38d45e2b8ddce4e4e9b882f37e8c0019db5f69e74ebee
|
@@ -16,14 +16,6 @@ module RSpec
|
|
16
16
|
instance_exec(*args, &shared_block)
|
17
17
|
end
|
18
18
|
|
19
|
-
def Test(message, options={}, &block)
|
20
|
-
Action :test, message, options, &block
|
21
|
-
end
|
22
|
-
|
23
|
-
def Step(message, options={}, &block)
|
24
|
-
Action :step, message, options, &block
|
25
|
-
end
|
26
|
-
|
27
19
|
def Given(message, options={}, &block)
|
28
20
|
Action :given, message, options, &block
|
29
21
|
end
|
data/lib/specify/spec.rb
CHANGED
@@ -3,9 +3,15 @@ module Specify
|
|
3
3
|
def self.included(base)
|
4
4
|
base.instance_eval do
|
5
5
|
alias :Background :before
|
6
|
-
alias :Setup
|
7
|
-
alias :Teardown
|
8
|
-
alias :
|
6
|
+
alias :Setup :before
|
7
|
+
alias :Teardown :after
|
8
|
+
alias :Feature :context
|
9
|
+
alias :Ability :context
|
10
|
+
alias :Story :context
|
11
|
+
alias :Rule :context
|
12
|
+
alias :rules :context
|
13
|
+
alias :steps :context
|
14
|
+
alias :tests :context
|
9
15
|
end
|
10
16
|
end
|
11
17
|
end
|
@@ -23,4 +29,24 @@ def self.Story(*args, &block)
|
|
23
29
|
describe(*args, &block)
|
24
30
|
end
|
25
31
|
|
32
|
+
def self.Component(*args, &block)
|
33
|
+
describe(*args, &block)
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.Rule(*args, &block)
|
37
|
+
describe(*args, &block)
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.rules(*args, &block)
|
41
|
+
describe(*args, &block)
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.steps(*args, &block)
|
45
|
+
describe(*args, &block)
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.tests(*args, &block)
|
49
|
+
describe(*args, &block)
|
50
|
+
end
|
51
|
+
|
26
52
|
RSpec.configuration.include Specify::Spec
|
data/lib/specify/version.rb
CHANGED
data/lib/specify.rb
CHANGED
@@ -30,10 +30,10 @@ if formatter = RSpec.world.reporter.find_registered_formatter(RSpec::Core::Forma
|
|
30
30
|
)
|
31
31
|
end
|
32
32
|
|
33
|
-
RSpec::Core::ExampleGroup.define_example_method :steps, with_steps: true
|
34
|
-
RSpec::Core::ExampleGroup.define_example_method :tests, with_steps: true
|
35
|
-
|
36
33
|
RSpec::Core::ExampleGroup.define_example_method :Scenario, with_steps: true
|
34
|
+
RSpec::Core::ExampleGroup.define_example_method :Condition, with_steps: true
|
35
|
+
RSpec::Core::ExampleGroup.define_example_method :Step, with_steps: true
|
36
|
+
RSpec::Core::ExampleGroup.define_example_method :Test, with_steps: true
|
37
37
|
|
38
38
|
require 'specify/rspec/shared_steps'
|
39
39
|
include RSpec::Specify::SharedSteps
|
data/spec/nested_spec.rb
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
Feature 'top-level feature block' do
|
4
|
+
Ability 'secondary-level ability block' do
|
5
|
+
specify 'specify some condition' do
|
6
|
+
@result = 'gets a result'
|
7
|
+
expect(@result).to eq('gets a result')
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
Feature 'top-level feature block' do
|
13
|
+
Story 'nested story block' do
|
14
|
+
specify 'specify some condition' do
|
15
|
+
@result = 'gets a result'
|
16
|
+
expect(@result).to eq('gets a result')
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
Story 'top-level story block' do
|
22
|
+
Feature 'nested feature block' do
|
23
|
+
Ability 'nested ability block' do
|
24
|
+
Rule 'nested rule block' do
|
25
|
+
Scenario 'nested scenario block' do
|
26
|
+
specify 'specify some condition' do
|
27
|
+
@result = 'gets a result'
|
28
|
+
expect(@result).to eq('gets a result')
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
Condition 'nested condition block' do
|
33
|
+
specify 'specify some condition' do
|
34
|
+
@result = 'gets a result'
|
35
|
+
expect(@result).to eq('gets a result')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
Component 'top-level component block' do
|
44
|
+
rules 'nested rules block' do
|
45
|
+
Rule 'nested rule keyword' do
|
46
|
+
specify 'specify some condition' do
|
47
|
+
@result = 'gets a result'
|
48
|
+
expect(@result).to eq('gets a result')
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
steps 'nested steps block' do
|
54
|
+
Step 'nested step block' do
|
55
|
+
specify 'specify some condition' do
|
56
|
+
@result = 'gets a result'
|
57
|
+
expect(@result).to eq('gets a result')
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
tests 'nested tests block' do
|
63
|
+
Test 'nested test block' do
|
64
|
+
specify 'specify some condition' do
|
65
|
+
@result = 'gets a result'
|
66
|
+
expect(@result).to eq('gets a result')
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
Ability 'Handle Pending Status' do
|
4
|
+
Scenario 'pending steps' do
|
5
|
+
Given 'context'
|
6
|
+
When 'action'
|
7
|
+
Then 'observable'
|
8
|
+
|
9
|
+
Given 'step without block and tag', pending: true
|
10
|
+
Given 'step without block and message', pending: 'wip'
|
11
|
+
end
|
12
|
+
end
|
data/spec/steps_spec.rb
CHANGED
@@ -1,74 +1,65 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
Feature' feature' do
|
4
|
+
Ability 'ability' do
|
5
|
+
Scenario 'scenario' do
|
6
6
|
Given 'context' do
|
7
|
-
@
|
7
|
+
@given = 'given'
|
8
8
|
end
|
9
9
|
|
10
10
|
When 'action' do
|
11
|
-
@
|
11
|
+
@when = 'when'
|
12
12
|
end
|
13
13
|
|
14
|
-
Then '
|
15
|
-
@
|
14
|
+
Then 'result' do
|
15
|
+
@then = 'then'
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
expect(@given).to eq('given')
|
19
|
+
expect(@when).to eq('when')
|
20
|
+
expect(@then).to eq('then')
|
21
|
+
end
|
21
22
|
|
22
|
-
|
23
|
-
|
23
|
+
Condition 'condition' do
|
24
|
+
When 'action' do
|
25
|
+
@when = 'when'
|
24
26
|
end
|
25
27
|
|
26
|
-
|
27
|
-
@
|
28
|
+
And 'action' do
|
29
|
+
@and = 'and'
|
28
30
|
end
|
29
31
|
|
30
|
-
|
31
|
-
@
|
32
|
+
But 'but' do
|
33
|
+
@but = 'but'
|
32
34
|
end
|
33
35
|
|
34
|
-
|
35
|
-
|
36
|
-
|
36
|
+
expect(@when).to eq('when')
|
37
|
+
expect(@and).to eq('and')
|
38
|
+
expect(@but).to eq('but')
|
39
|
+
end
|
37
40
|
|
38
|
-
|
39
|
-
|
41
|
+
Step 'step' do
|
42
|
+
it 'it' do
|
43
|
+
@it = 'it'
|
40
44
|
end
|
41
45
|
|
42
|
-
|
43
|
-
@
|
46
|
+
specify 'specify' do
|
47
|
+
@specify = 'specify'
|
44
48
|
end
|
45
49
|
|
46
|
-
expect(@
|
47
|
-
expect(@
|
48
|
-
expect(@result).to eq('Then value')
|
49
|
-
expect(@and).to eq('And value')
|
50
|
-
expect(@but).to eq('But value')
|
51
|
-
expect(@generic).to eq('Generic value')
|
52
|
-
expect(@it).to eq('It value')
|
53
|
-
expect(@specify).to eq('Specify value')
|
54
|
-
expect(@test).to eq('Test value')
|
55
|
-
expect(@step).to eq('Step value')
|
50
|
+
expect(@it).to eq('it')
|
51
|
+
expect(@specify).to eq('specify')
|
56
52
|
end
|
57
|
-
end
|
58
53
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
Then 'step without block'
|
54
|
+
Test 'test' do
|
55
|
+
_ 'generic' do
|
56
|
+
@generic = 'generic'
|
57
|
+
end
|
64
58
|
|
65
|
-
|
66
|
-
Given 'step without block and message', pending: 'wip'
|
59
|
+
expect(@generic).to eq('generic')
|
67
60
|
end
|
68
|
-
end
|
69
61
|
|
70
|
-
|
71
|
-
steps 'will fail' do
|
62
|
+
Condition 'failing steps' do
|
72
63
|
expect {
|
73
64
|
_ 'expectation alerts failure' do
|
74
65
|
expect(2 + 2).to eq 5
|
@@ -76,5 +67,4 @@ Ability 'specify steps' do
|
|
76
67
|
}.to raise_error
|
77
68
|
end
|
78
69
|
end
|
79
|
-
|
80
70
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
Feature 'top-level feature block' do
|
4
|
+
end
|
5
|
+
|
6
|
+
Ability 'top-level ability block' do
|
7
|
+
end
|
8
|
+
|
9
|
+
Story 'top-level story block' do
|
10
|
+
end
|
11
|
+
|
12
|
+
Rule 'top-level rule block' do
|
13
|
+
end
|
14
|
+
|
15
|
+
Component 'top-level component block' do
|
16
|
+
end
|
17
|
+
|
18
|
+
rules 'top-level rules block' do
|
19
|
+
end
|
20
|
+
|
21
|
+
steps 'top-level steps block' do
|
22
|
+
end
|
23
|
+
|
24
|
+
tests 'top-level tests block' do
|
25
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Nyman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -90,16 +90,19 @@ files:
|
|
90
90
|
- lib/specify/rspec/world.rb
|
91
91
|
- lib/specify/spec.rb
|
92
92
|
- lib/specify/version.rb
|
93
|
+
- spec/nested_spec.rb
|
94
|
+
- spec/pending_spec.rb
|
93
95
|
- spec/shared_steps_spec.rb
|
94
96
|
- spec/spec_helper.rb
|
95
97
|
- spec/steps_spec.rb
|
98
|
+
- spec/top_level_spec.rb
|
96
99
|
- specify.gemspec
|
97
100
|
homepage: https://github.com/jnyman/specify
|
98
101
|
licenses:
|
99
102
|
- MIT
|
100
103
|
metadata: {}
|
101
104
|
post_install_message: "\n(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n\n
|
102
|
-
\ Specify 0.
|
105
|
+
\ Specify 0.6.0 has been installed.\n\n(::) (::) (::) (::) (::) (::) (::) (::) (::)
|
103
106
|
(::) (::) (::)\n "
|
104
107
|
rdoc_options: []
|
105
108
|
require_paths:
|
@@ -121,6 +124,9 @@ signing_key:
|
|
121
124
|
specification_version: 4
|
122
125
|
summary: Description Language Specification and Execution Engine
|
123
126
|
test_files:
|
127
|
+
- spec/nested_spec.rb
|
128
|
+
- spec/pending_spec.rb
|
124
129
|
- spec/shared_steps_spec.rb
|
125
130
|
- spec/spec_helper.rb
|
126
131
|
- spec/steps_spec.rb
|
132
|
+
- spec/top_level_spec.rb
|