rspec-requestable-examples 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rspec/requestable-examples.rb +12 -1
- metadata +42 -21
@@ -12,6 +12,10 @@ module RSpec
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
+
def examples_that_can_be_requested
|
16
|
+
@examples_that_can_be_requested ||= []
|
17
|
+
end
|
18
|
+
|
15
19
|
def request_examples(options)
|
16
20
|
@requested_examples = RequestedExamples.new(options)
|
17
21
|
end
|
@@ -21,7 +25,7 @@ module RSpec
|
|
21
25
|
end
|
22
26
|
|
23
27
|
def requestable_example(description, options={}, &blk)
|
24
|
-
|
28
|
+
examples_that_can_be_requested << description
|
25
29
|
it description, &blk if requested_examples.run?(options[:as] || description)
|
26
30
|
end
|
27
31
|
alias_method :requestable_it, :requestable_example
|
@@ -36,6 +40,13 @@ module RSpec
|
|
36
40
|
describe description, &blk if requested_examples.run?(label)
|
37
41
|
end
|
38
42
|
alias_method :requestable_context, :requestable_describe
|
43
|
+
|
44
|
+
def verify_requested_examples!
|
45
|
+
missing_examples = requested_examples - examples_that_can_be_requested
|
46
|
+
if missing_examples.any?
|
47
|
+
raise %|Trying to request examples that don't exist:\n#{missing_examples.join("\n")}|
|
48
|
+
end
|
49
|
+
end
|
39
50
|
end
|
40
51
|
|
41
52
|
end
|
metadata
CHANGED
@@ -1,46 +1,67 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-requestable-examples
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Zach Dennis
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
17
|
+
|
18
|
+
date: 2012-01-05 00:00:00 -05:00
|
19
|
+
default_executable:
|
13
20
|
dependencies: []
|
21
|
+
|
14
22
|
description: See home page
|
15
23
|
email: zach.dennis@gmail.com
|
16
24
|
executables: []
|
25
|
+
|
17
26
|
extensions: []
|
27
|
+
|
18
28
|
extra_rdoc_files: []
|
19
|
-
|
29
|
+
|
30
|
+
files:
|
20
31
|
- lib/rspec/requestable-examples.rb
|
32
|
+
has_rdoc: true
|
21
33
|
homepage: http://www.continuousthinking.com
|
22
34
|
licenses: []
|
35
|
+
|
23
36
|
post_install_message:
|
24
37
|
rdoc_options: []
|
25
|
-
|
38
|
+
|
39
|
+
require_paths:
|
26
40
|
- lib
|
27
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
28
42
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
33
|
-
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
hash: 3
|
47
|
+
segments:
|
48
|
+
- 0
|
49
|
+
version: "0"
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
51
|
none: false
|
35
|
-
requirements:
|
36
|
-
- -
|
37
|
-
- !ruby/object:Gem::Version
|
38
|
-
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
hash: 3
|
56
|
+
segments:
|
57
|
+
- 0
|
58
|
+
version: "0"
|
39
59
|
requirements: []
|
60
|
+
|
40
61
|
rubyforge_project:
|
41
|
-
rubygems_version: 1.
|
62
|
+
rubygems_version: 1.3.7
|
42
63
|
signing_key:
|
43
64
|
specification_version: 3
|
44
|
-
summary: rspec-requestable-examples let's you include specific examples from shared
|
45
|
-
example sets
|
65
|
+
summary: rspec-requestable-examples let's you include specific examples from shared example sets
|
46
66
|
test_files: []
|
67
|
+
|