Sha256: 070cd2606e89ca1417a11affc4720cd6c982fab5beee1415afcbd5a50592bbae

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

# Load the helper class
require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')

module TaliaCore
  # Test the DataRecord storage class
  class DataRecordTest < Test::Unit::TestCase

    fixtures :active_sources, :data_records

    def setup
      @test_records = DataTypes::DataRecord.find_data_records(Fixtures.identify(:something))

      @image_mime_types = ['image/gif', 'image/jpeg', 'image/png', 'image/tiff', 'image/bmp']
    end

    # test not nil and records numbers
    def test_records_numbers
      assert_not_equal [], @test_records
      assert_equal 15, @test_records.size
    end

    # test class type and mime_type
    def test_mime_types
      assert_kind_of(DataTypes::SimpleText, @test_records[0])
      assert_kind_of(DataTypes::SimpleText, @test_records[1])
      assert_equal("text/plain", @test_records[0].mime_type)
      assert_equal("text/plain", @test_records[1].mime_type)
    end



    # test for specific classes methods
    def test_specific_classes_methods
      # Get a line
      line = "LINE1: This is a simple text to check the DataRecords class\n"
      assert_equal(line, @test_records[0].get_line)
    end

  end  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
talia_core-0.4.2 test/talia_core/data_types/data_record_test.rb
talia_core-0.4.1 test/talia_core/data_types/data_record_test.rb
talia_core-0.4.0 test/talia_core/data_types/data_record_test.rb