Sha256: 5c6c22f1358e85a1254999966b036690d21c5a36ea8710864a9b83b9e32d9034

Contents?: true

Size: 616 Bytes

Versions: 8

Compression:

Stored size: 616 Bytes

Contents

require 'helper'

module Keyrack
  module Store
    class TestFilesystem < Test::Unit::TestCase
      def test_read
        path = fixture_path('foo.txt')
        store = Filesystem.new('path' => path)
        assert_equal File.read(path), store.read
      end

      def test_write
        path = get_tmpname
        store = Filesystem.new('path' => path)
        store.write("foobar")
        assert_equal "foobar", File.read(path)
      end

      def test_read_returns_nil_for_non_existant_file
        store = Filesystem.new('path' => 'blargityblargh')
        assert_nil store.read
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
keyrack-0.3.0.pre test/keyrack/store/test_filesystem.rb
keyrack-0.2.3 test/keyrack/store/test_filesystem.rb
keyrack-0.2.2 test/keyrack/store/test_filesystem.rb
keyrack-0.2.1 test/keyrack/store/test_filesystem.rb
keyrack-0.2.0 test/keyrack/store/test_filesystem.rb
keyrack-0.1.3 test/keyrack/store/test_filesystem.rb
keyrack-0.1.2 test/keyrack/store/test_filesystem.rb
keyrack-0.1.1 test/keyrack/store/test_filesystem.rb