Sha256: d49371b1b21ac11b0b3bbbf8976444a730578ae3a67089a56648aad38bad05e1

Contents?: true

Size: 1.34 KB

Versions: 28

Compression:

Stored size: 1.34 KB

Contents

require 'test_helper'

class DictionaryTest < Minitest::Test
  # This line includes all default Spout Dictionary tests
  include Spout::Tests

  # This line provides access to @variables, @forms, and @domains iterators
  # iterators that can be used to write custom tests
  include Spout::Helpers::Iterators

  # Example 1: Create custom tests to show that `integer` and `numeric` variables have a valid unit type
  # VALID_UNITS = ['minutes', 'hours'] # Add your own valid units to this array
  # @variables.select{|v| v.type == 'numeric' or v.type == 'integer'}.each do |variable|
  #   define_method("test_units: "+variable.path) do
  #     message = "\"#{variable.units}\"".colorize( :red ) + " invalid units.\n" +
  #               "             Valid types: " +
  #               VALID_UNITS.sort.collect{|u| u.inspect.colorize( :white )}.join(', ')
  #     assert VALID_UNITS.include?(variable.units), message
  #   end
  # end

  # Example 2: Create custom tests to show that variables have 2 or more labels.
  # @variables.select{|v| ['numeric','integer'].include?(v.type)}.each do |variable|
  #   define_method("test_at_least_two_labels: "+variable.path) do
  #     assert_operator 2, :<=, variable.labels.size
  #   end
  # end

  # Example 3: Create regular Ruby tests
  # You may add additional tests here
  # def test_truth
  #   assert true
  # end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
spout-0.11.0.beta1 lib/spout/templates/test/dictionary_test.rb
spout-0.10.2 lib/spout/templates/test/dictionary_test.rb
spout-0.10.1 lib/spout/templates/test/dictionary_test.rb
spout-0.10.0 lib/spout/templates/test/dictionary_test.rb
spout-0.10.0.rc3 lib/spout/templates/test/dictionary_test.rb
spout-0.10.0.rc2 lib/spout/templates/test/dictionary_test.rb
spout-0.10.0.rc lib/spout/templates/test/dictionary_test.rb
spout-0.10.0.beta10 lib/spout/templates/test/dictionary_test.rb
spout-0.10.0.beta9 lib/spout/templates/test/dictionary_test.rb
spout-0.10.0.beta8 lib/spout/templates/test/dictionary_test.rb
spout-0.10.0.beta7 lib/spout/templates/test/dictionary_test.rb
spout-0.10.0.beta6 lib/spout/templates/test/dictionary_test.rb
spout-0.10.0.beta4 lib/spout/templates/test/dictionary_test.rb
spout-0.10.0.beta3 lib/spout/templates/test/dictionary_test.rb
spout-0.10.0.beta2 lib/spout/templates/test/dictionary_test.rb
spout-0.10.0.beta1 lib/spout/templates/test/dictionary_test.rb
spout-0.9.1 lib/spout/templates/test/dictionary_test.rb
spout-0.9.0 lib/spout/templates/test/dictionary_test.rb
spout-0.9.0.rc lib/spout/templates/test/dictionary_test.rb
spout-0.9.0.beta2 lib/spout/templates/test/dictionary_test.rb