matest 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/matest/example_group.rb +52 -1
- data/lib/matest/top_level_methods.rb +1 -1
- data/lib/matest/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2daca4d267143ef3fcf29ab0f7aa428f9c68e3c6
|
4
|
+
data.tar.gz: 81fc1a71724139e129f8fc027932bf0930f14259
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c6d0f0ed1082347f1109a83b28cacd38c3e2e6bc7f0e0cd9493fe107ec31260638482ed162ae3d053d290714f3bf4844129a3f68943c678c327a40d24b056ad
|
7
|
+
data.tar.gz: 930b85be27691aa152c5c6a4f22fac5fcbddf145343085c610b0cc3c5aa2db38bc26ca2b3daa8344bc1fd122c940d292817a310d9980e5238e8602b049ea7500
|
data/lib/matest/example_group.rb
CHANGED
@@ -1,4 +1,55 @@
|
|
1
1
|
module Matest
|
2
|
+
class SkippedExampleGroup
|
3
|
+
attr_reader :scope_block
|
4
|
+
|
5
|
+
attr_accessor :printer
|
6
|
+
attr_reader :specs
|
7
|
+
attr_reader :statuses
|
8
|
+
|
9
|
+
def initialize(scope_block)
|
10
|
+
@scope_block = scope_block
|
11
|
+
@specs = []
|
12
|
+
@statuses = []
|
13
|
+
end
|
14
|
+
|
15
|
+
def execute!
|
16
|
+
instance_eval(&scope_block)
|
17
|
+
specs.each do |spec|
|
18
|
+
res = run_spec(spec)
|
19
|
+
printer.print(res)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def run_spec(spec)
|
24
|
+
status = Matest::SpecSkipped.new(spec, true)
|
25
|
+
@statuses << status
|
26
|
+
status
|
27
|
+
end
|
28
|
+
|
29
|
+
def scope(description=nil, &block)
|
30
|
+
Matest::Runner.runner << Matest::SkippedExampleGroup.new(block)
|
31
|
+
end
|
32
|
+
alias :xscope :scope
|
33
|
+
alias :describe :scope
|
34
|
+
alias :xdescribe :xscope
|
35
|
+
|
36
|
+
alias :context :scope
|
37
|
+
alias :xcontext :xscope
|
38
|
+
|
39
|
+
alias :group :scope
|
40
|
+
alias :xgroup :xscope
|
41
|
+
|
42
|
+
def spec(description=nil, &block)
|
43
|
+
current_example = ->(*args) { Matest::SkipMe.new }
|
44
|
+
specs << Example.new(current_example, description, [])
|
45
|
+
end
|
46
|
+
alias :xspec :spec
|
47
|
+
alias :example :spec
|
48
|
+
alias :xexample :spec
|
49
|
+
alias :it :spec
|
50
|
+
alias :xit :spec
|
51
|
+
end
|
52
|
+
|
2
53
|
class ExampleGroup
|
3
54
|
attr_reader :scope_block
|
4
55
|
attr_reader :specs
|
@@ -6,7 +57,7 @@ module Matest
|
|
6
57
|
attr_reader :statuses
|
7
58
|
|
8
59
|
attr_accessor :printer
|
9
|
-
|
60
|
+
|
10
61
|
def initialize(scope_block)
|
11
62
|
@scope_block = scope_block
|
12
63
|
@specs = []
|
data/lib/matest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Federico Iachetti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|