Skip to content

Commit

Permalink
using name of tower in tower select
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanb committed Jan 17, 2009
1 parent 38b3f6c commit e7ad903
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/ruby_warrior/tower.rb
Expand Up @@ -9,5 +9,6 @@ def initialize(path)
def name
File.basename(path)
end
alias_method :to_s, :name
end
end
4 changes: 4 additions & 0 deletions spec/ruby_warrior/tower_spec.rb
Expand Up @@ -8,4 +8,8 @@
it "should consider last part of path as name" do
@tower.name.should == 'tower'
end

it "should use name when converting to string" do
@tower.to_s.should == @tower.name
end
end

0 comments on commit e7ad903

Please sign in to comment.