Sha256: 03902567f1c639ab922185bf4eaa32af4f32de629e73353926d2ddca7a1e673b

Contents?: true

Size: 714 Bytes

Versions: 1

Compression:

Stored size: 714 Bytes

Contents

require 'spec_helper'
module Viiite
  describe Tms, ".coerce" do

    subject{ Tms.coerce(arg) }

    describe "from zero" do
      let(:arg){ 0.0 }
      it { should eq Tms[0.0, 0.0, 0.0, 0.0, 0.0] }
    end

    describe "from one" do
      let(:arg){ 1.0 }
      it { should eq Tms[1.0, 0.0, 0.0, 0.0, 0.0] }
    end

    describe "from a complete hash" do
      let(:arg){ {
        :utime => 1.0,
        :stime => 2.0,
        :cutime => 3.0,
        :cstime => 4.0,
        :real => 5.0,
      } }
      it { should eq Tms[1.0, 2.0, 3.0, 4.0, 5.0] }
    end

    describe "from an array" do
      let(:arg){ [1.0, 2.0, 3.0, 4.0, 5.0] }
      it { should eq Tms[1.0, 2.0, 3.0, 4.0, 5.0] }
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
viiite-0.2.0 spec/unit/tms/test_coerce.rb