rename @repositories => @paths
This commit is contained in:
parent
6a6c4c1e19
commit
f393202f8e
@ -70,7 +70,7 @@ class Suite
|
|||||||
def initialize(name)
|
def initialize(name)
|
||||||
@repository_name = name
|
@repository_name = name
|
||||||
@path = expand(File.join(Suite.test_tmpdir, name.to_s))
|
@path = expand(File.join(Suite.test_tmpdir, name.to_s))
|
||||||
@repositories = [@path]
|
@paths = [@path]
|
||||||
@commands = []
|
@commands = []
|
||||||
@successful = true
|
@successful = true
|
||||||
end
|
end
|
||||||
@ -92,8 +92,8 @@ class Suite
|
|||||||
!@successful
|
!@successful
|
||||||
end
|
end
|
||||||
|
|
||||||
def repository(path)
|
def add_path(path)
|
||||||
@repositories << path
|
@paths << path
|
||||||
end
|
end
|
||||||
|
|
||||||
def command(cmd, output = nil)
|
def command(cmd, output = nil)
|
||||||
@ -103,15 +103,15 @@ class Suite
|
|||||||
end
|
end
|
||||||
|
|
||||||
def run!
|
def run!
|
||||||
@repositories.each { |r| run(r) }
|
@paths.each { |p| run(p) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def run(r)
|
def run(path)
|
||||||
puts "Integration tests for #{r}"
|
puts "Integration tests for #{path}"
|
||||||
puts
|
puts
|
||||||
@commands.each do |c|
|
@commands.each do |c|
|
||||||
clone(r) do
|
clone(path) do
|
||||||
@successful = false unless c.run!(r)
|
@successful = false unless c.run!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
puts
|
puts
|
||||||
@ -170,7 +170,7 @@ class Suite
|
|||||||
@after = block
|
@after = block
|
||||||
end
|
end
|
||||||
|
|
||||||
def run!(repository)
|
def run!
|
||||||
puts "$ git media #{@cmd}"
|
puts "$ git media #{@cmd}"
|
||||||
actual = Suite.exec @cmd
|
actual = Suite.exec @cmd
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
require File.expand_path("../suite", __FILE__)
|
require File.expand_path("../suite", __FILE__)
|
||||||
|
|
||||||
Suite.test :empty do |t|
|
Suite.test :empty do |t|
|
||||||
t.repository File.join(t.path, ".git")
|
t.add_path File.join(t.path, ".git")
|
||||||
t.repository File.join(t.path, "subdir") # sub directory!
|
t.add_path File.join(t.path, "subdir") # sub directory!
|
||||||
|
|
||||||
# really simple test
|
# really simple test
|
||||||
t.command "version",
|
t.command "version",
|
||||||
|
Loading…
Reference in New Issue
Block a user