Sha256: 64913fd2181086946bca5b1e443fcb87fcfd3548a023c7e04c7b27b4e88c7f8c

Contents?: true

Size: 649 Bytes

Versions: 1

Compression:

Stored size: 649 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.type= "DVD"

    assert_equal("DVD", ds.type)
  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.2.0 test/tc_datastore.rb