mosso 0.0.23 → 0.0.24
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/README.md +4 -3
- data/lib/measure.rb +1 -1
- data/lib/mosso/version.rb +1 -1
- data/spec/mosso_spec.rb +36 -26
- 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: bb7e22adeb977ca4005c2d90bb990da34a87a504
|
4
|
+
data.tar.gz: 39d726f44bdd5c9736125ac15a56d67619b47dbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af265b7610de6995534c4b8f9deea1c28c0511ab614d5050c133edda87ba3dfb3b4499b3997da9449177e06aafb82adaf94dc7100ecaed6194b77b4ba85c5895
|
7
|
+
data.tar.gz: e64baa532eaba7a4b7f1c49eedac7469c55ce06e53accae7eb138cc32cab83fa2479059dd99f50482f336c3c396cc4fcfc70fecd542671276ba603c7c6da1dc7
|
data/README.md
CHANGED
@@ -25,9 +25,10 @@ Or install it yourself as:
|
|
25
25
|
...
|
26
26
|
puts m
|
27
27
|
|
28
|
-
STDOUT:
|
29
|
-
|
30
|
-
|
28
|
+
STDOUT:
|
29
|
+
|
30
|
+
ExecutionTime: 2.000249151 [sec]
|
31
|
+
FileName: /home/user/products/gems/mosso/spec/mosso_spec.rb, Line: 32
|
31
32
|
|
32
33
|
## Contributing
|
33
34
|
|
data/lib/measure.rb
CHANGED
data/lib/mosso/version.rb
CHANGED
data/spec/mosso_spec.rb
CHANGED
@@ -2,34 +2,44 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Mosso do
|
4
4
|
it 'should have a version number' do
|
5
|
-
Mosso::VERSION.
|
6
|
-
Mosso::VERSION.
|
5
|
+
expect(Mosso::VERSION).not_to eq(nil)
|
6
|
+
expect(Mosso::VERSION).to eql("0.0.24")
|
7
7
|
end
|
8
8
|
|
9
9
|
it 'should measure rightly the execution time' do
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
10
|
+
line1 = "Exection Time: "
|
11
|
+
line2 = "FileName: "
|
12
|
+
|
13
|
+
# initialize
|
14
|
+
measure = Measure.new
|
15
|
+
sleep 1
|
16
|
+
expect(measure.exection_time().round).to eq(1)
|
17
|
+
l1, l2 = measure.to_s.split("\n")
|
18
|
+
expect(l1).to match Regexp.new("^#{line1}1\.\\d{9}\\s\\[sec\\]")
|
19
|
+
expect(l2).to match Regexp.new("^#{line2}")
|
20
|
+
|
21
|
+
# exection_time
|
22
|
+
sleep 2
|
23
|
+
expect(measure.exection_time().round).to eq(3)
|
24
|
+
l1, l2 = measure.to_s.split("\n")
|
25
|
+
expect(l1).to match Regexp.new("^#{line1}3\.\\d{9}\\s\\[sec\\]")
|
26
|
+
expect(l2).to match Regexp.new("^#{line2}")
|
27
|
+
|
28
|
+
# reset
|
29
|
+
measure.reset
|
30
|
+
sleep 1
|
31
|
+
expect(measure.exection_time().round).to eq(1)
|
32
|
+
l1, l2 = measure.to_s.split("\n")
|
33
|
+
expect(l1).to match Regexp.new("^#{line1}1\.\\d{9}\\s\\[sec\\]")
|
34
|
+
expect(l2).to match Regexp.new("^#{line2}")
|
35
|
+
|
36
|
+
# start
|
37
|
+
measure.start
|
38
|
+
sleep 2
|
39
|
+
expect(measure.exection_time().round).to eq(2)
|
40
|
+
l1, l2 = measure.to_s.split("\n")
|
41
|
+
expect(l1).to match Regexp.new("^#{line1}2\.\\d{9}\\s\\[sec\\]")
|
42
|
+
expect(l2).to match Regexp.new("^#{line2}")
|
34
43
|
end
|
35
44
|
end
|
45
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mosso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ryosy383
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|