Skip to content
This repository
Browse code

improved tests

  • Loading branch information...
commit 4c0a1fb0038a4ad47818a893f16bfdeee8e0a6bd 1 parent f8d0c38
Phil Hagelberg authored

Showing 1 changed file with 8 additions and 1 deletion. Show diff stats Hide diff stats

  1. +8 1 test/test_conspire.rb
9 test/test_conspire.rb
@@ -30,6 +30,8 @@ def setup
30 30 end
31 31
32 32 Conspire.start(LOCAL_SPACE, OpenStruct.new(:port => 7457))
  33 + File.open(LOCAL_SPACE + '/file2', 'w') { |f| f.puts "hello world!" }
  34 + `cd #{LOCAL_SPACE}; git add file2; git commit -m "conspire"`
33 35 end
34 36
35 37 def teardown
@@ -42,16 +44,21 @@ def teardown
42 44
43 45 def test_start
44 46 assert File.exist?(LOCAL_SPACE + '/.git')
  47 + assert(system("cd #{LOCAL_SPACE} && git pull --rebase git://localhost:7458/"),
  48 + "Could not rebase from remote.")
45 49 end
46 50
47 51 def test_discover
48   - Conspire.discover
  52 + Conspire.discover 1
49 53 assert_equal [7458], Conspire.conspirators.map{ |c| c.port }
50 54 end
51 55
52 56 def test_sync
53 57 Conspire.conspirators << Conspire::Conspirator.new('localhost.', '7458')
54 58 Conspire.sync_all
  59 +
  60 + assert Conspire.conspirators.last, "Dropped remote conspirator"
  61 + assert_equal 'localhost', Conspire.conspirators.last.host
55 62 assert_equal ["#{LOCAL_SPACE}/file"], Dir.glob("#{LOCAL_SPACE}/*")
56 63 end
57 64

0 comments on commit 4c0a1fb

Please sign in to comment.
Something went wrong with that request. Please try again.