Sha256: c4a704c83ff48437d2f0e606fae7a9f78a6218b1a372477c3d73a5bb64bdc7fc

Contents?: true

Size: 574 Bytes

Versions: 2

Compression:

Stored size: 574 Bytes

Contents

require "spec_helper"

describe Tabs::Resolutions::Month do
  let(:timestamp){ Time.utc(2000, 1, 15) }

  context "#normalize" do
    it "should normalize the date to year, month" do
      expect(subject.normalize(timestamp)).to eq(timestamp.change(day: 1))
    end
  end

  context "#serialize" do
    it "should return YYYY-MM" do
      expect(subject.serialize(timestamp)).to eq("2000-01")
    end
  end

  context "#deserialize" do
    it "should convert string into date" do
      expect(subject.deserialize("2000-01")).to eq(timestamp.change(day: 1))
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tabs-1.0.1 spec/lib/tabs/resolutions/month_spec.rb
tabs-1.0.0 spec/lib/tabs/resolutions/month_spec.rb