Sha256: fcd39c0cc9c036e9d6cec9b4ce2c4ff38291892d37b2fca6e3aee872205c5524

Contents?: true

Size: 964 Bytes

Versions: 27

Compression:

Stored size: 964 Bytes

Contents

require File.expand_path('../test_helper', __FILE__)

describe "gitdocs runner" do
  it "should clone files" do
    with_clones(3) do |clone1, clone2, clone3|
      File.open(File.join(clone1, "test"), 'w') { |f| f << "testing" }
      sleep 3
      assert_equal "testing", File.read(File.join(clone1, "test"))
      assert_equal "testing", File.read(File.join(clone2, "test"))
      assert_equal "testing", File.read(File.join(clone3, "test"))
    end
  end

  it "should resolve conflicts files" do
    with_clones(3) do |clone1, clone2, clone3|
      File.open(File.join(clone1, "test.txt"), 'w') { |f| f << "testing" }
      sleep 3
      File.open(File.join(clone1, "test.txt"), 'w') { |f| f << "testing\n1" }
      File.open(File.join(clone2, "test.txt"), 'w') { |f| f << "testing\n2" }
      sleep 3
      assert_includes 2..3, Dir[File.join(clone2, "*.txt")].to_a.size
      assert_includes 2..3, Dir[File.join(clone3, "*.txt")].to_a.size
    end
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
gitdocs-0.4.15 test/runner_test.rb
siuying-gitdocs-0.4.16 test/runner_test.rb
siuying-gitdocs-0.4.15 test/runner_test.rb
siuying-gitdocs-0.4.14 test/runner_test.rb
siuying-gitdocs-0.4.14.md test/runner_test.rb
gitdocs-0.4.14 test/runner_test.rb
gitdocs-0.4.13 test/runner_test.rb
gitdocs-0.4.12 test/runner_test.rb
gitdocs-0.4.11 test/runner_test.rb
gitdocs-0.4.10 test/runner_test.rb
gitdocs-0.4.9 test/runner_test.rb
gitdocs-0.4.8 test/runner_test.rb
gitdocs-0.4.7 test/runner_test.rb
gitdocs-0.4.6 test/runner_test.rb
gitdocs-0.4.5 test/runner_test.rb
gitdocs-0.4.3 test/runner_test.rb
gitdocs-0.4.2 test/runner_test.rb
gitdocs-0.4.1 test/runner_test.rb
gitdocs-0.4.0 test/runner_test.rb
gitdocs-0.3.6 test/runner_test.rb