Sha256: d732f7e871f4bdd220d583e85d92df73f010a68abc25ba66bc79696b881d42c3

Contents?: true

Size: 1.67 KB

Versions: 14

Compression:

Stored size: 1.67 KB

Contents

# encoding: utf-8

require 'helper'

# Author: lurraca github.com/lurraca
class TestUnitsMetric < Test::Unit::TestCase
  def setup
    @tester = Faker::UnitMetric
  end

  def test_length_name
    length_name = @tester.length_name
    assert Faker::UnitMetric::LENGTH_UNITS.any?{ |hash| hash[:name] == length_name }
  end

  def test_length_abbrev
    length_abbr = @tester.length_abbr
    assert Faker::UnitMetric::LENGTH_UNITS.any?{ |hash| hash[:abbreviation] == length_abbr }
  end

  def test_mass_name
    mass_name = @tester.mass_name
    assert Faker::UnitMetric::MASS_UNITS.any?{ |hash| hash[:name] == mass_name }
  end

  def test_mass_abbr
    mass_abbr = @tester.mass_abbr
    assert Faker::UnitMetric::MASS_UNITS.any?{ |hash| hash[:abbreviation] == mass_abbr }
  end

  def test_liquid_name
    liquid_name = @tester.liquid_name
    assert Faker::UnitMetric::LIQUID_UNITS.any?{ |hash| hash[:name] == liquid_name }
  end

  def test_liquid_abbr
    liquid_abbr = @tester.liquid_abbr
    assert Faker::UnitMetric::LIQUID_UNITS.any?{ |hash| hash[:abbreviation] == liquid_abbr }
  end

  def test_volume_name
    volume_name = @tester.volume_name
    assert Faker::UnitMetric::VOLUME_UNITS.any?{ |hash| hash[:name] == volume_name }
  end

  def test_volume_abbr
    volume_abbr = @tester.volume_abbr
    assert Faker::UnitMetric::VOLUME_UNITS.any?{ |hash| hash[:abbreviation] == volume_abbr }
  end

  def test_area_name
    area_name = @tester.area_name
    assert Faker::UnitMetric::AREA_UNITS.any?{ |hash| hash[:name] == area_name }
  end

  def test_area_abbr
    area_abbr = @tester.area_abbr
    assert Faker::UnitMetric::AREA_UNITS.any?{ |hash| hash[:abbreviation] == area_abbr }
  end

end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
solidus_backend-1.0.0.pre3 vendor/bundle/gems/ffaker-1.32.1/test/test_units_metric.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/ffaker-1.32.1/test/test_units_metric.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/ffaker-1.32.1/test/test_units_metric.rb
ffaker-1.32.1 test/test_units_metric.rb
ffaker-1.32.0 test/test_units_metric.rb
ffaker-1.31.0 test/test_units_metric.rb
ffaker-1.30.0 test/test_units_metric.rb
ffaker-1.25.0 test/test_units_metric.rb
ffaker-1.24.0 test/test_units_metric.rb
ffakerer-1.0.2 test/test_units_metric.rb
ffaker-1.23.0 test/test_units_metric.rb
ffakerer-1.0.1 test/test_units_metric.rb
ffaker-1.22.1 test/test_units_metric.rb
ffaker-1.22.0 test/test_units_metric.rb