Sha256: 6c5a58072c1ed36debb23cc322144ea7bbf959ec4ee85ae94e656ae2ae17e801

Contents?: true

Size: 659 Bytes

Versions: 1

Compression:

Stored size: 659 Bytes

Contents

require 'test/unit'
require 'filentory/datastore'

class TestDatastore < Test::Unit::TestCase
  def test_initialisation_with_a_name 
    ds = Datastore.new("a name")

    assert_equal("a name", ds.name)
  end

  def test_can_set_a_type
    ds = Datastore.new("")
    ds.mediatype= "DVD"

    assert_equal("DVD", ds.mediatype)
  end

  def test_can_add_array_of_files
    ds = Datastore.new("File")
    names = ["a", "b"]
    ds.files= Array.new (names)

    assert_equal(names, ds.files)
  end

  def test_can_add__files
    ds = Datastore.new("File")
    names = ["a", "b"]
    ds.files << "a"
    ds.files << "b"

    assert_equal(names, ds.files)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
filentory-cli-0.3.0 test/tc_datastore.rb