Sha256: c69ec274cab5da305470da6201be19266731059d9f2e5fee157df6fead6cb838

Contents?: true

Size: 695 Bytes

Versions: 12

Compression:

Stored size: 695 Bytes

Contents

describe AwsLogs::Since do
  let(:since) { AwsLogs::Since.new(str) }

  context "friendly format" do
    context "5m" do
      let(:str) { "5m" }
      it "5m" do
        expect(since.to_i).to eq 300
      end
    end

    context "1hr" do
      let(:str) { "1h" }
      it "1h" do
        expect(since.to_i).to eq 3600
      end
    end

    context "junk" do
      let(:str) { "junk" }
      it "junk" do
        expect(since.to_i).to eq 600 # fallback
      end
    end
  end

  context "iso8601 format" do
    context "2018-08-08 08:08:08" do
      let(:str) { "2018-08-08 08:08:08" }
      it "2018-08-08 08:08:08" do
        expect(since.to_i).to be_a(Integer)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
aws-logs-1.0.0 spec/lib/since_spec.rb
aws-logs-0.5.1 spec/lib/since_spec.rb
aws-logs-0.5.0 spec/lib/since_spec.rb
aws-logs-0.4.1 spec/lib/since_spec.rb
aws-logs-0.4.0 spec/lib/since_spec.rb
aws-logs-0.3.4 spec/lib/since_spec.rb
aws-logs-0.3.3 spec/lib/since_spec.rb
aws-logs-0.3.2 spec/lib/since_spec.rb
aws-logs-0.3.1 spec/lib/since_spec.rb
aws-logs-0.3.0 spec/lib/since_spec.rb
aws-logs-0.2.0 spec/lib/since_spec.rb
aws-logs-0.1.0 spec/lib/since_spec.rb