Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
add failing specs for setup_shards
Browse files Browse the repository at this point in the history
  • Loading branch information
freels committed Aug 31, 2010
1 parent 5a7bd78 commit 6c15e72
Show file tree
Hide file tree
Showing 5 changed files with 509 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Rakefile
@@ -1,5 +1,6 @@
require 'rubygems'
require 'rake'
require 'spec/rake/spectask'

begin
require 'jeweler'
Expand All @@ -23,6 +24,14 @@ Rake::TestTask.new(:test) do |test|
test.verbose = true
end

Spec::Rake::SpecTask.new(:spec) do |t|
spec_opts = File.expand_path('spec/spec.opts')
if File.exist? spec_opts
t.spec_opts = ['--options', "\"#{spec_opts}\""]
end
t.spec_files = FileList['spec/**/*_spec.rb']
end

begin
require 'rcov/rcovtask'
Rcov::RcovTask.new do |test|
Expand All @@ -37,7 +46,7 @@ rescue LoadError
end

task :test do
puts
puts
puts "=" * 79
puts "You might want to read the README before running tests."
puts "=" * 79
Expand Down
82 changes: 82 additions & 0 deletions spec/shard_template_spec.rb
@@ -0,0 +1,82 @@
require File.expand_path('../spec_helper', __FILE__)

describe Gizzard::ShardTemplate do
describe "concrete?" do
end

describe "valid?" do
end

describe "java_type" do
end

describe "identifier" do
end

describe "host" do
end

describe "children" do
end

describe "descendant_identifiers" do
end

describe "copy_sources" do
end

describe "copy_source" do
end

describe "materialization methods" do
describe "to_shard_id" do
end

describe "to_shard_info" do
end
end

describe "comparison methods" do
describe "similar?" do
end

describe "<=>" do
end

describe "eql?" do
end

describe "hash" do
end
end

describe "config methods" do
describe "to_config" do
end
end

describe "nameserver inspection class methods" do
describe "existing_template_map" do
end

describe "build_tree" do
end

describe "collect_links" do
end

describe "collect_shards" do
end
end

describe "config class methods" do
describe "from_config" do
end

describe "parse_link_struct" do
end

describe "parse_shard_definition" do
end
end
end
7 changes: 7 additions & 0 deletions spec/spec.opts
@@ -0,0 +1,7 @@
--colour
--format progress
--loadby mtime
--reverse
--timeout 20
--diff
--backtrace
24 changes: 24 additions & 0 deletions spec/spec_helper.rb
@@ -0,0 +1,24 @@
$:.unshift File.expand_path('../../lib', __FILE__)

require 'rubygems'

# testing requires
require 'spec'
require 'rr'

Spec::Runner.configure do |config|
config.mock_with :rr
end

# source requires
require 'gizzard'
require 'gizzard/nameserver'
require 'gizzard/transformation'
require 'gizzard/migrator'
require 'gizzard/shard_template'


def make_shard_template(config)
config = YAML.load(config) if config.is_a? String
Gizzard::ShardTemplate.from_config(config)
end

0 comments on commit 6c15e72

Please sign in to comment.