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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2430f32f6cf89256dd605d5d6228e432b53ea2ee
4
- data.tar.gz: 1b653289580fb62fd1e25310e6ff0f4236807ab8
3
+ metadata.gz: bb7e22adeb977ca4005c2d90bb990da34a87a504
4
+ data.tar.gz: 39d726f44bdd5c9736125ac15a56d67619b47dbd
5
5
  SHA512:
6
- metadata.gz: 985f6dd4c9e8bbcf3f40e80d86cdea39e511accc138864521f61c0d7b89ea55d1fb1abb23138c945d284b1d7b12af7c9b08b7100fe983e554e9b7709f6fdd801
7
- data.tar.gz: a5133899298c1a0447f9d38e18d974f8cc62c9e2f253bb3d3f1132d5cfd83c9e4771901a1a68bc695d081e389e3d76977ae061a31a5e801a53b59519587e882d
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
- Exection Time: 2.000249151 [sec]
30
- FileName: /home/user/products/gems/mosso/spec/mosso_spec.rb, Line: 32"
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
@@ -7,7 +7,7 @@ class Measure
7
7
  def to_s
8
8
  ret = []
9
9
  file, line = parse_caller(caller.first)
10
- ret << "ExecutionTime: #{exection_time()} [sec]"
10
+ ret << "Exection Time: #{exection_time()} [sec]"
11
11
  ret << "FileName: #{file}, Line: #{line}"
12
12
  ret << "\n"
13
13
  ret.join("\n")
data/lib/mosso/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mosso
2
- VERSION = "0.0.23"
2
+ VERSION = "0.0.24"
3
3
  end
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.should_not be_nil
6
- Mosso::VERSION.should == "0.0.23"
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
- # initialize
12
- measure = Measure.new
13
- sleep 1
14
- measure.exection_time().round.should be_eql(1)
15
- puts measure
16
-
17
- # exection_time
18
- sleep 2
19
- measure.exection_time().round.should be_eql(3)
20
- puts measure
21
-
22
- # reset
23
- measure.reset
24
- sleep 1
25
- measure.exection_time().round.should be_eql(1)
26
- puts measure
27
-
28
- # start
29
- measure.start
30
- sleep 2
31
- measure.exection_time().round.should be_eql(2)
32
- puts measure
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.23
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-03-22 00:00:00.000000000 Z
11
+ date: 2014-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler