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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43000ef8ff695e1145e0231dede3d6d9d8f8cb8b
4
- data.tar.gz: 8bb568afc64165565c9301b6f6bf6bb24eace722
3
+ metadata.gz: 2daca4d267143ef3fcf29ab0f7aa428f9c68e3c6
4
+ data.tar.gz: 81fc1a71724139e129f8fc027932bf0930f14259
5
5
  SHA512:
6
- metadata.gz: 95ad7ce7cf09365daf1994db43387fc7fca2659d773b73de76e7859511647ca5abad305b037230bb57ef94d7a8737988f6b14ee1f1961932ae0111d4f9ff1d5a
7
- data.tar.gz: d74fc2fa2350be58d2379511c09d076b837bd106d5b8d87dc9ae86ac4b60f92807ee2e02d125ec75144134eb8db0d283f077fd87327eaa4100e7ba20f0d69b47
6
+ metadata.gz: 8c6d0f0ed1082347f1109a83b28cacd38c3e2e6bc7f0e0cd9493fe107ec31260638482ed162ae3d053d290714f3bf4844129a3f68943c678c327a40d24b056ad
7
+ data.tar.gz: 930b85be27691aa152c5c6a4f22fac5fcbddf145343085c610b0cc3c5aa2db38bc26ca2b3daa8344bc1fd122c940d292817a310d9980e5238e8602b049ea7500
@@ -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 = []
@@ -3,7 +3,7 @@ def scope(description=nil, &block)
3
3
  end
4
4
 
5
5
  def xscope(description=nil, &block)
6
- # no-op
6
+ Matest::Runner.runner << Matest::SkippedExampleGroup.new(block)
7
7
  end
8
8
 
9
9
  alias :describe :scope
@@ -1,3 +1,3 @@
1
1
  module Matest
2
- VERSION = "1.6.1"
2
+ VERSION = "1.6.2"
3
3
  end
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.1
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-06 00:00:00.000000000 Z
11
+ date: 2015-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler