Sha256: 24d8873fe3c92f5fc03eaa3c7e9633b1227e52337840722494dbc0e3998b22c7

Contents?: true

Size: 815 Bytes

Versions: 6

Compression:

Stored size: 815 Bytes

Contents

require 'spec_helper'
require 'gb_work_day/core_ext/integer'
require 'gb_work_day/duration'

describe 'Integer extensions' do

  it 'should respond work_days' do
    expect(2.work_days).to be_kind_of GBWorkDay::Duration
    expect(2.work_days.work_days).to eq 2
    expect(2.work_days.week).to eq GBWorkDay::WorkWeek.current
  end

  it 'should respond work_day' do
    expect(1.work_day).to be_kind_of GBWorkDay::Duration
    expect(1.work_day.work_days).to eq 1
    expect(1.work_day.week).to eq GBWorkDay::WorkWeek.current
  end

  it 'should setup proper week on work_days' do
    week = GBWorkDay::WorkWeek.new(5, 1)
    expect(2.work_days(week).week).to eq week
  end

  it 'should be able to sum' do
    expect(1.work_day + 2).to eq 3.work_days
    expect(1.work_day + 2.work_day).to eq 3.work_days
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gb_work_day-0.1.0 spec/core_ext/integer_spec.rb
gb_work_day-0.0.6 spec/core_ext/integer_spec.rb
gb_work_day-0.0.4 spec/core_ext/integer_spec.rb
gb_work_day-0.0.3 spec/core_ext/integer_spec.rb
gb_work_day-0.0.2 spec/core_ext/integer_spec.rb
gb_work_day-0.0.1 spec/core_ext/integer_spec.rb