-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# spec作成 | ||
require 'pathname' | ||
arg = ARGV.shift | ||
|
||
filename = "./spec/#{File.basename(arg)}_spec.rb" | ||
classname = File.basename(arg, ".rb") | ||
file = Pathname.new(filename) | ||
|
||
unless file.exist? | ||
file.open('w') {|f| f.puts DATA.read.gsub('__package__',arg).gsub('__ClassName__',classname.capitalize).gsub('__classname__', classname ) } | ||
end | ||
|
||
__END__ | ||
# __classname__:Specファイル | ||
# -*- coding: utf-8 -*- | ||
require File.join(File.dirname(__FILE__), "spec_help") | ||
$:.unshift(File.join(File.expand_path("."), "src")) | ||
|
||
require '__package__' | ||
include Unlight | ||
|
||
describe __ClassName__, "がある時は" do | ||
before(:all) do | ||
# 初期化 | ||
# @__classname__ = __ClassName__.new | ||
# @registered = false | ||
end | ||
|
||
before(:each) do | ||
# 各exampleについての前処理 | ||
end | ||
|
||
it "****のとき****が成功する" do | ||
# @registered = @players.register(@test_player_name, "password") | ||
# @registered.should be_true | ||
end | ||
|
||
it "*****のとき****すると失敗する" do | ||
# @players.register(@test_player_name, "password").should be_false | ||
end | ||
it "*****のとき****結果は*****" do | ||
# @players.register(@test_player_name, "password").should == "x" | ||
end | ||
|
||
after(:each) do | ||
# 各exampleについての後処理 | ||
end | ||
|
||
after(:all) do | ||
# 後処理 | ||
@__classname__ = nil | ||
end | ||
|
||
end | ||
|
||
|
||
|
||
|