specify 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0024e122861fdbe3a31ea6b410c85aa1b73a5491
4
- data.tar.gz: e9301f788cc95ab78344881695151990c999b2de
3
+ metadata.gz: 8a168d4a8b7345ed5b16cd6c43da66c2363de56d
4
+ data.tar.gz: 530ed45e4c88fd822a26f044ee568d93ab93a0a3
5
5
  SHA512:
6
- metadata.gz: 744c0ac39ac901fcde94a34afe286ea4bc00f33232a53f18110a724ffdba89d865b5d7cb87246d918dbd839d7d4123c4f661eb635e9f396b2ab458dc6fdeea67
7
- data.tar.gz: 461e753360434699be5c91226e04fa673b593f7c59d7f83c307a10e3b916a570b4b958b85af524e2ee1b95bdc67c53d4802e8976bf495155022740e8d504549e
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 :before
7
- alias :Teardown :after
8
- alias :Ability :context
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
@@ -1,3 +1,3 @@
1
1
  module Specify
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.0'
3
3
  end
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
@@ -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
- Ability 'specify steps' do
4
- describe 'Given/When/Then' do
5
- steps 'should execute blocks' do
3
+ Feature' feature' do
4
+ Ability 'ability' do
5
+ Scenario 'scenario' do
6
6
  Given 'context' do
7
- @context = 'Given value'
7
+ @given = 'given'
8
8
  end
9
9
 
10
10
  When 'action' do
11
- @action = 'When value'
11
+ @when = 'when'
12
12
  end
13
13
 
14
- Then 'observable' do
15
- @result = 'Then value'
14
+ Then 'result' do
15
+ @then = 'then'
16
16
  end
17
17
 
18
- And 'and' do
19
- @and = 'And value'
20
- end
18
+ expect(@given).to eq('given')
19
+ expect(@when).to eq('when')
20
+ expect(@then).to eq('then')
21
+ end
21
22
 
22
- But 'but' do
23
- @but = 'But value'
23
+ Condition 'condition' do
24
+ When 'action' do
25
+ @when = 'when'
24
26
  end
25
27
 
26
- _ 'generic' do
27
- @generic = 'Generic value'
28
+ And 'action' do
29
+ @and = 'and'
28
30
  end
29
31
 
30
- it 'it' do
31
- @it = 'It value'
32
+ But 'but' do
33
+ @but = 'but'
32
34
  end
33
35
 
34
- specify 'specify' do
35
- @specify = 'Specify value'
36
- end
36
+ expect(@when).to eq('when')
37
+ expect(@and).to eq('and')
38
+ expect(@but).to eq('but')
39
+ end
37
40
 
38
- Test 'test' do
39
- @test = 'Test value'
41
+ Step 'step' do
42
+ it 'it' do
43
+ @it = 'it'
40
44
  end
41
45
 
42
- Step 'step' do
43
- @step = 'Step value'
46
+ specify 'specify' do
47
+ @specify = 'specify'
44
48
  end
45
49
 
46
- expect(@context).to eq('Given value')
47
- expect(@action).to eq('When value')
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
- describe 'Steps without blocks' do
60
- tests 'will be pending' do
61
- Given 'step without block'
62
- When 'step without block'
63
- Then 'step without block'
54
+ Test 'test' do
55
+ _ 'generic' do
56
+ @generic = 'generic'
57
+ end
64
58
 
65
- Given 'step without block and tag', pending: true
66
- Given 'step without block and message', pending: 'wip'
59
+ expect(@generic).to eq('generic')
67
60
  end
68
- end
69
61
 
70
- describe 'Failing steps' do
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.5.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-06 00:00:00.000000000 Z
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.5.0 has been installed.\n\n(::) (::) (::) (::) (::) (::) (::) (::) (::)
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