Sha256: e447ac4a49af81aef68dbe9b4e16ebedfd4924f03b45dcb19e2132ec16e16fec

Contents?: true

Size: 808 Bytes

Versions: 5

Compression:

Stored size: 808 Bytes

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:42 BST | dinner          | medication | humalog       |  6.0 x10^-5 L"
  end

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

  drop_test_db
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
insulin-0.0.18 spec/day_spec.rb
insulin-0.0.17 spec/day_spec.rb
insulin-0.0.16 spec/day_spec.rb
insulin-0.0.15 spec/day_spec.rb
insulin-0.0.14 spec/day_spec.rb