use rspec
Sho Hashimoto [Sun, 4 Jul 2010 11:04:20 +0000 (20:04 +0900)]
Manifest.txt
README.rdoc
Rakefile
lib/shinagawaseaside/ShinagawaSeaside.rb [deleted file]
lib/shinagawaseaside/task.rb [deleted file]
spec/shinagawaseaside_spec.rb [new file with mode: 0644]
spec/spec.opts [new file with mode: 0644]
spec/spec_helper.rb [new file with mode: 0644]
tasks/rspec.rake [new file with mode: 0644]
test/test_helper.rb [deleted file]
test/test_shinagawaseaside.rb [deleted file]

index 4dc2ef9..8f917a0 100644 (file)
@@ -7,5 +7,9 @@ lib/shinagawaseaside.rb
 script/console
 script/destroy
 script/generate
-test/test_helper.rb
-test/test_shinagawaseaside.rb
+spec/shinagawaseaside_spec.rb
+spec/spec.opts
+spec/spec_helper.rb
+tasks/rspec.rake
+samples/Rakefile
+
index 2ae4aaa..243e435 100644 (file)
@@ -1,32 +1,36 @@
 = shinagawaseaside
 
-* http://github.com/#{github_username}/#{project_name}
+* http://github.com/shokai/shinagawaseaside
 
 == DESCRIPTION:
 
-FIX (describe your package)
+add rake tasks they start/stop tokyo tyrant server
 
-== FEATURES/PROBLEMS:
+== SYNOPSIS:
 
-* FIX (list of features or problems)
+    require 'rubygems'
+    require 'shinagawaseaside'
 
-== SYNOPSIS:
+    ttdb = [ { :name => 'users', :port => 20010},
+             { :name => 'videos',:port => 20011},
+             { :name => 'comments', :port => 20012} ]
+
+    ShinagawaSeaside::set(ttdb, :basedir => File.dirname(__FILE__)+'/ttdb')
 
-  FIX (code sample of usage)
 
 == REQUIREMENTS:
 
-* FIX (list of requirements)
+* TokyoTyrant
 
 == INSTALL:
 
-* FIX (sudo gem install, anything else)
+* sudo gem install ShinagawaSeaside
 
 == LICENSE:
 
 (The MIT License)
 
-Copyright (c) 2010 FIXME full name
+Copyright (c) 2010 Sho Hashimoto
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
index 7edef5d..73d361c 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -11,8 +11,8 @@ Hoe.plugin :newgem
 # Generate all the Rake tasks\r
 # Run 'rake -T' to see list of generated tasks (from gem root directory)\r
 $hoe = Hoe.spec 'shinagawaseaside' do\r
-  self.developer 'FIXME full name', 'FIXME email'\r
-  self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required\r
+  self.developer 'Sho Hashimoto', 'hashimoto@shokai.org'\r
+  # self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required\r
   self.rubyforge_name       = self.name # TODO this is default value\r
   # self.extra_deps         = [['activesupport','>= 2.0.2']]\r
 \r
diff --git a/lib/shinagawaseaside/ShinagawaSeaside.rb b/lib/shinagawaseaside/ShinagawaSeaside.rb
deleted file mode 100644 (file)
index 83878b0..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module ShinagawaSeaside::Task
-desc 'shinagawa'
-task 'shinagawa' do
-  puts 'start shinagawa'
-end
diff --git a/lib/shinagawaseaside/task.rb b/lib/shinagawaseaside/task.rb
deleted file mode 100644 (file)
index 027a711..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-puts 'load task'
-
diff --git a/spec/shinagawaseaside_spec.rb b/spec/shinagawaseaside_spec.rb
new file mode 100644 (file)
index 0000000..afdb080
--- /dev/null
@@ -0,0 +1,11 @@
+require File.dirname(__FILE__) + '/spec_helper.rb'
+
+# Time to add your specs!
+# http://rspec.info/
+describe "Place your specs here" do
+  
+  it "find this spec in spec directory" do
+    # violated "Be sure to write your specs"
+  end
+  
+end
diff --git a/spec/spec.opts b/spec/spec.opts
new file mode 100644 (file)
index 0000000..cf6add7
--- /dev/null
@@ -0,0 +1 @@
+--colour
\ No newline at end of file
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
new file mode 100644 (file)
index 0000000..2d53e3f
--- /dev/null
@@ -0,0 +1,10 @@
+begin
+  require 'spec'
+rescue LoadError
+  require 'rubygems' unless ENV['NO_RUBYGEMS']
+  gem 'rspec'
+  require 'spec'
+end
+
+$:.unshift(File.dirname(__FILE__) + '/../lib')
+require 'shinagawaseaside'
diff --git a/tasks/rspec.rake b/tasks/rspec.rake
new file mode 100644 (file)
index 0000000..31a99b0
--- /dev/null
@@ -0,0 +1,21 @@
+begin
+  require 'spec'
+rescue LoadError
+  require 'rubygems' unless ENV['NO_RUBYGEMS']
+  require 'spec'
+end
+begin
+  require 'spec/rake/spectask'
+rescue LoadError
+  puts <<-EOS
+To use rspec for testing you must install rspec gem:
+    gem install rspec
+EOS
+  exit(0)
+end
+
+desc "Run the specs under spec/models"
+Spec::Rake::SpecTask.new do |t|
+  t.spec_opts = ['--options', "spec/spec.opts"]
+  t.spec_files = FileList['spec/**/*_spec.rb']
+end
diff --git a/test/test_helper.rb b/test/test_helper.rb
deleted file mode 100644 (file)
index 33220e8..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-require 'stringio'
-require 'test/unit'
-require File.dirname(__FILE__) + '/../lib/shinagawaseaside'
diff --git a/test/test_shinagawaseaside.rb b/test/test_shinagawaseaside.rb
deleted file mode 100644 (file)
index e5c4020..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-require File.dirname(__FILE__) + '/test_helper.rb'\r
-\r
-class TestShinagawaseaside < Test::Unit::TestCase\r
-\r
-  def setup\r
-  end\r
-  \r
-  def test_truth\r
-    assert true\r
-  end\r
-end\r