moto 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/assert.rb +32 -28
- data/lib/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: bf48b861993cd786e2c5b00c0db3b03487b039a7
|
4
|
+
data.tar.gz: 534ab46d6f0d346856b9ab68f415ed6cfd168360
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a5e0b9faf31928964213633ad46b7f95b3e00a2f42c4c4981f629e529cdbfe108c895f05b848279c7cbde7a49e0a3af0075c1ecc3bc76b507892b242c56154a
|
7
|
+
data.tar.gz: c6ba59d4bf795d99860dc55e5ad806e90e448d087aa6745aca5abc08fcd2fc66ec03527fb460cc940837cf60c48bf42a3bd1cfaaf02dedb7a42d2a4691ef2ae5
|
data/lib/assert.rb
CHANGED
@@ -1,28 +1,32 @@
|
|
1
|
-
module Moto
|
2
|
-
module Assert
|
3
|
-
|
4
|
-
def assert_equal(a, b)
|
5
|
-
assert(a==b, "Arguments should be equal: #{a} != #{b}.")
|
6
|
-
end
|
7
|
-
|
8
|
-
def assert_true(b)
|
9
|
-
assert(b, "Logical condition not met, expecting true, given false.")
|
10
|
-
end
|
11
|
-
|
12
|
-
def
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end
|
1
|
+
module Moto
|
2
|
+
module Assert
|
3
|
+
|
4
|
+
def assert_equal(a, b)
|
5
|
+
assert(a==b, "Arguments should be equal: #{a} != #{b}.")
|
6
|
+
end
|
7
|
+
|
8
|
+
def assert_true(b)
|
9
|
+
assert(b, "Logical condition not met, expecting true, given false.")
|
10
|
+
end
|
11
|
+
|
12
|
+
def assert_false(b)
|
13
|
+
assert(!b, "Logical condition not met, expecting false, given true.")
|
14
|
+
end
|
15
|
+
|
16
|
+
def assert(condition, message)
|
17
|
+
unless condition
|
18
|
+
|
19
|
+
line_number = if @context.current_test.evaled
|
20
|
+
caller.select{ |l| l.match(/\(eval\):\d*:in `run'/) }.first[/\d+/].to_i - 1 # -1 because of added method header in generated class
|
21
|
+
else
|
22
|
+
line_number = caller.select{ |l| l.match(/#{@context.current_test.static_path}:\d*:in `run'/) }.first[/\d+/].to_i - 1
|
23
|
+
end
|
24
|
+
|
25
|
+
full_message = "ASSERTION FAILED in line #{line_number}: #{message}"
|
26
|
+
@context.runner.result.add_failure(self, full_message)
|
27
|
+
logger.error(full_message)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bartek Wilczek
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-01-
|
13
|
+
date: 2016-01-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|