From 34656ec2b797ea30a43f8a54c209db249b293eed Mon Sep 17 00:00:00 2001 From: Sho Hashimoto Date: Sun, 4 Jul 2010 20:04:20 +0900 Subject: [PATCH] use rspec --- Manifest.txt | 8 ++++++-- README.rdoc | 22 +++++++++++++--------- Rakefile | 4 ++-- lib/shinagawaseaside/ShinagawaSeaside.rb | 6 ------ lib/shinagawaseaside/task.rb | 3 --- spec/shinagawaseaside_spec.rb | 11 +++++++++++ spec/spec.opts | 1 + spec/spec_helper.rb | 10 ++++++++++ tasks/rspec.rake | 21 +++++++++++++++++++++ test/test_helper.rb | 3 --- test/test_shinagawaseaside.rb | 11 ----------- 11 files changed, 64 insertions(+), 36 deletions(-) delete mode 100644 lib/shinagawaseaside/ShinagawaSeaside.rb delete mode 100644 lib/shinagawaseaside/task.rb create mode 100644 spec/shinagawaseaside_spec.rb create mode 100644 spec/spec.opts create mode 100644 spec/spec_helper.rb create mode 100644 tasks/rspec.rake delete mode 100644 test/test_helper.rb delete mode 100644 test/test_shinagawaseaside.rb diff --git a/Manifest.txt b/Manifest.txt index 4dc2ef9..8f917a0 100644 --- a/Manifest.txt +++ b/Manifest.txt @@ -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 + diff --git a/README.rdoc b/README.rdoc index 2ae4aaa..243e435 100644 --- a/README.rdoc +++ b/README.rdoc @@ -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 diff --git a/Rakefile b/Rakefile index 7edef5d..73d361c 100644 --- a/Rakefile +++ b/Rakefile @@ -11,8 +11,8 @@ Hoe.plugin :newgem # Generate all the Rake tasks # Run 'rake -T' to see list of generated tasks (from gem root directory) $hoe = Hoe.spec 'shinagawaseaside' do - self.developer 'FIXME full name', 'FIXME email' - self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required + self.developer 'Sho Hashimoto', 'hashimoto@shokai.org' + # self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required self.rubyforge_name = self.name # TODO this is default value # self.extra_deps = [['activesupport','>= 2.0.2']] diff --git a/lib/shinagawaseaside/ShinagawaSeaside.rb b/lib/shinagawaseaside/ShinagawaSeaside.rb deleted file mode 100644 index 83878b0..0000000 --- a/lib/shinagawaseaside/ShinagawaSeaside.rb +++ /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 index 027a711..0000000 --- a/lib/shinagawaseaside/task.rb +++ /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 index 0000000..afdb080 --- /dev/null +++ b/spec/shinagawaseaside_spec.rb @@ -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 index 0000000..cf6add7 --- /dev/null +++ b/spec/spec.opts @@ -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 index 0000000..2d53e3f --- /dev/null +++ b/spec/spec_helper.rb @@ -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 index 0000000..31a99b0 --- /dev/null +++ b/tasks/rspec.rake @@ -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 index 33220e8..0000000 --- a/test/test_helper.rb +++ /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 index e5c4020..0000000 --- a/test/test_shinagawaseaside.rb +++ /dev/null @@ -1,11 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper.rb' - -class TestShinagawaseaside < Test::Unit::TestCase - - def setup - end - - def test_truth - assert true - end -end -- 1.6.3