Sha256: c9d43c48eaffc2148df48fdc51049e686a3d8e3288a3776be7e5ed6f56cf11b1

Contents?: true

Size: 1.01 KB

Versions: 9

Compression:

Stored size: 1.01 KB

Contents

require 'insulin'
require "spec_helper.rb"

describe Insulin::Day do
  load_test_db

  d = Insulin::Day.new "2012-06-30", @mongo

  it "should contain something" do
    d.keys.size.should > 0
  end

  it "should have events" do
    d.keys.each do |k|
      d[k].each do |e|
        e.class.name.should == "Insulin::Event"
      end
    end
  end

  it "should have glucose events" do
    d["glucose"].each do |g|
      g["type"].should == "glucose"
    end
  end

  it "should have at most 1 lantus event" do
    d["lantus"].size.should < 2
  end

  it "should display correctly" do
    d.to_s.should include "19:07 | dinner          | medication     | humalog       | 6x10^-5 L"
    d.to_s.should include "15:46 | after lunch     | blood pressure |               | 118/75 sp/df"
    d.to_s.should include "15:46 |                 | hba1c          |               | 8.8%"
  end

  it "minimal display should be correct" do
    d.minimal.should_not include "exercise"
    d.minimal.should_not include "after"
  end

  drop_test_db
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
insulin-0.1.11 spec/day_spec.rb
insulin-0.1.10 spec/day_spec.rb
insulin-0.1.9 spec/day_spec.rb
insulin-0.1.8 spec/day_spec.rb
insulin-0.1.7 spec/day_spec.rb
insulin-0.1.6 spec/day_spec.rb
insulin-0.1.5 spec/day_spec.rb
insulin-0.1.4 spec/day_spec.rb
insulin-0.1.3 spec/day_spec.rb