Sha256: 9eeef3aeb5a62b7992ce4e36b019d668d17d47d38851321794ae1783c83b3c19

Contents?: true

Size: 719 Bytes

Versions: 2

Compression:

Stored size: 719 Bytes

Contents

require 'helper'

class TestLevel < WasserstandTestCase
  def test_size
    assert_equal(534, Level.all.size)
  end

  def test_kms
    elbe_levels = Waterway['ELBE'].levels
    assert_equal(60, elbe_levels.size)

    assert_level({:name => 'PIRNA', :km => 34.67, :measurements_size => 1}, elbe_levels['PIRNA'])
  end

  def test_lookup
    pirna = Level['Pirna']
    assert(pirna)
    assert(pirna.waterway)
    assert_equal('ELBE', pirna.waterway.name)

    assert(Level['GENTHIN'])
  end

  private

  def assert_level(values, level)
    assert(level)
    assert_equal(values[:name], level.name)
    assert_equal(values[:km], level.km)
    assert_equal(values[:measurements_size], level.measurements.size)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wasserstand-0.0.10 test/unit/test_level.rb
wasserstand-0.0.9 test/unit/test_level.rb