Sha256: 6a27c617de4b069275ea7d795c00f26ed46792f52ca82a4c65bfebfe5c9b4ca6

Contents?: true

Size: 903 Bytes

Versions: 9

Compression:

Stored size: 903 Bytes

Contents

# frozen_string_literal: true

require_relative 'helper'
require 'ostruct'

class TestUnits < Test::Unit::TestCase
  include DeterministicHelper

  assert_methods_are_deterministic(
    FFakerTW::Unit,
    :time_name, :time_abbr, :temperature_name, :temperature_abbr
  )

  def setup
    @tester = FFakerTW::Unit
    @time_units = @tester::TIME_UNITS.map { |u| OpenStruct.new u }
    @temperature_units = @tester::TEMPERATURE_UNITS.map { |u| OpenStruct.new u }
  end

  def test_time_name
    assert_include @time_units.map(&:name), @tester.time_name
  end

  def test_time_abbr
    assert_include @time_units.map(&:abbreviation), @tester.time_abbr
  end

  def test_temperature_name
    assert_include @temperature_units.map(&:name), @tester.temperature_name
  end

  def test_temperature_abbr
    assert_include \
      @temperature_units.map(&:abbreviation),
      @tester.temperature_abbr
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ffakerTW-1.8.0 test/test_units.rb
ffakerTW-1.7.0 test/test_units.rb
ffakerTW-1.6.0 test/test_units.rb
ffakerTW-1.5.0 test/test_units.rb
ffakerTW-1.4.0 test/test_units.rb
ffakerTW-1.3.0 test/test_units.rb
ffakerTW-1.2.0 test/test_units.rb
ffakerTW-1.1.0 test/test_units.rb
ffakerTW-0.1.0 test/test_units.rb