Sha256: 8504c3781fe7548fe3ae4a1b92654d0e7a4acf62c480722dd65025db2f8a9c42

Contents?: true

Size: 707 Bytes

Versions: 15

Compression:

Stored size: 707 Bytes

Contents

# ~*~ encoding: utf-8 ~*~
path = File.join(File.dirname(__FILE__), "helper")
require File.expand_path(path)

context "File" do
  setup do
    @wiki = Gollum::Wiki.new(testpath("examples/lotr.git"))
  end

  test "new file" do
    file = Gollum::File.new(@wiki)
    assert_nil file.raw_data
  end

  test "existing file" do
    commit = @wiki.repo.commits.first
    file   = @wiki.file("Mordor/todo.txt")
    assert_equal "[ ] Write section on Ents\n", file.raw_data
    assert_equal 'todo.txt',         file.name
    assert_equal commit.id,          file.version.id
    assert_equal commit.author.name, file.version.author.name
  end

  test "accessing tree" do
    assert_nil @wiki.file("Mordor")
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
gollum-2.2.1 test/test_file.rb
gollum-2.2.0 test/test_file.rb
gollum-2.1.10 test/test_file.rb
gollum-2.1.9 test/test_file.rb
gollum-2.1.8 test/test_file.rb
gollum-2.1.7 test/test_file.rb
gollum-2.1.6 test/test_file.rb
gollum-2.1.4 test/test_file.rb
gollum-2.1.3 test/test_file.rb
gollum-2.1.2 test/test_file.rb
gollum-2.1.0 test/test_file.rb
gollum-2.0.0 test/test_file.rb
gollum-1.4.3 test/test_file.rb
gollum-1.4.2 test/test_file.rb
read-only-gollum-1.4.0 test/test_file.rb