Sha256: f7a937c11e52660d30ec12348d95f3d6800d2a10d218ce693b4f8d49b3f19e73

Contents?: true

Size: 451 Bytes

Versions: 5

Compression:

Stored size: 451 Bytes

Contents

require_relative '../spec_helper'

describe 'Numbers' do
  it 'should support arbitrary multiply' do
    expect(sequence(1, 2, 3, 4, 5).map(multiply(5))).to eq(sequence(5, 10, 15, 20, 25))
  end

  it 'should treat multiply as a monoid' do
    expect(empty.reduce(multiply(5))).to eq(1)
  end

  it 'should be able to get powers_of a number' do
    expect(powers_of(3).take(10)).to eq(sequence(1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683))
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
totally_lazy-0.1.62 spec/totally_lazy/numbers_spec.rb
totally_lazy-0.1.61 spec/totally_lazy/numbers_spec.rb
totally_lazy-0.1.60 spec/totally_lazy/numbers_spec.rb
totally_lazy-0.1.59 spec/totally_lazy/numbers_spec.rb
totally_lazy-0.1.58 spec/totally_lazy/numbers_spec.rb