matest 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/matest.rb +9 -9
- data/lib/matest/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 106a40de6a36b7d1d7221244deda124306329545
|
4
|
+
data.tar.gz: c093d22db122b4293f588613501213496f5974a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84a55dd97dc70e9af4e8a6e51c70fe3b321aadf5aadd7d3e57da14a266a354885588c8268512d47bcd544afa83fcdcac4355ddb41ca4ab71f239369ceffd3c24
|
7
|
+
data.tar.gz: c17087cc4946f55fa00b9d8b5a2958573ee6e02e6a4cb3ff699fe5025cbe1c3ed71586ffc27441e7617abc9a9d982a195d182cf61e49ed50eae834062cf09ee6
|
data/lib/matest.rb
CHANGED
@@ -9,10 +9,10 @@ module Matest
|
|
9
9
|
attr_reader :info
|
10
10
|
attr_reader :printer
|
11
11
|
|
12
|
-
def initialize(
|
12
|
+
def initialize(options={})
|
13
13
|
@example_groups = []
|
14
14
|
@info = {}
|
15
|
-
@printer = printer
|
15
|
+
@printer = options[:printer] || SpecPrinter.new
|
16
16
|
end
|
17
17
|
|
18
18
|
def self.runner
|
@@ -50,7 +50,7 @@ module Matest
|
|
50
50
|
@__description = description
|
51
51
|
lets.each do |let|
|
52
52
|
self.class.let(let.var_name, &let.block)
|
53
|
-
send(let.var_name) if let.
|
53
|
+
send(let.var_name) if let.bang
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
@@ -72,12 +72,12 @@ module Matest
|
|
72
72
|
class Let
|
73
73
|
attr_reader :var_name
|
74
74
|
attr_reader :block
|
75
|
-
attr_reader :
|
75
|
+
attr_reader :bang
|
76
76
|
|
77
|
-
def initialize(var_name, block,
|
77
|
+
def initialize(var_name, block, bang=false)
|
78
78
|
@var_name = var_name
|
79
79
|
@block = block
|
80
|
-
@
|
80
|
+
@bang = bang
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
@@ -123,12 +123,12 @@ module Matest
|
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|
126
|
-
def let(var_name,
|
127
|
-
lets << Let.new(var_name, block,
|
126
|
+
def let(var_name, bang=false, &block)
|
127
|
+
lets << Let.new(var_name, block, bang=false)
|
128
128
|
end
|
129
129
|
|
130
130
|
def let!(var_name, &block)
|
131
|
-
lets << Let.new(var_name, block,
|
131
|
+
lets << Let.new(var_name, block, bang=true)
|
132
132
|
end
|
133
133
|
|
134
134
|
def run_spec(spec)
|
data/lib/matest/version.rb
CHANGED