Sha256: fec6d8b9f352305511e624004409c885480692eb561050b9a4203348da9a9b0f
Contents?: true
Size: 931 Bytes
Versions: 126
Compression:
Stored size: 931 Bytes
Contents
# frozen_string_literal: true RSpec.describe :next_occurring do link :next_occurring, from: :ree_datetime it { monday = next_occurring(DateTime.new(2022, 5, 23, 13, 15, 20), :monday) wednesday = next_occurring(DateTime.new(2022, 5, 19, 13, 15, 20), :wednesday) thursday = next_occurring(DateTime.new(2022, 5, 23, 13, 15, 20), :thursday) saturday = next_occurring(DateTime.new(2022, 5, 23, 13, 15, 20), :saturday) sunday = next_occurring(DateTime.new(2022, 5, 8, 13, 15, 20), :sunday) expect(monday).to eq(DateTime.new(2022, 5, 30, 13, 15, 20)) expect(wednesday).to eq(DateTime.new(2022, 5, 25, 13, 15, 20)) expect(thursday).to eq(DateTime.new(2022, 6, 2, 13, 15, 20)) expect(saturday).to eq(DateTime.new(2022, 6, 4, 13, 15, 20)) expect(sunday).to eq(DateTime.new(2022, 5, 15, 13, 15, 20)) } it { result = next_occurring(:sunday) expect(result).to be_a(DateTime) } end
Version data entries
126 entries across 126 versions & 1 rubygems