Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bunch of spec failures under 1.8.7 (the code actually worked bu…
…t the specs failed). Introduce EmptyTrie to remove redundant calls to Trie.new. Bump version.
- Loading branch information
Simon Harris
committed
Feb 14, 2010
1 parent
cf82a95
commit 9eb08d7
Showing
15 changed files
with
112 additions
and
20 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
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
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
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
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
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Hamster | ||
|
||
VERSION = "0.2.9".freeze | ||
VERSION = "0.2.10".freeze | ||
|
||
end |
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
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
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
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,33 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
require 'hamster/list' | ||
require 'hamster/set' | ||
|
||
describe Hamster::List do | ||
|
||
describe "#to_set" do | ||
|
||
[ | ||
[], | ||
["A"], | ||
["A", "B", "C"], | ||
].each do |values| | ||
|
||
describe "on #{values.inspect}" do | ||
|
||
before do | ||
original = Hamster.list(*values) | ||
@result = original.to_set | ||
end | ||
|
||
it "returns self" do | ||
@result.should == Hamster.set(*values) | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
end | ||
|
||
end |
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,44 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
require 'hamster/stack' | ||
|
||
describe Hamster::Stack do | ||
|
||
describe "#to_ary" do | ||
|
||
describe "enables implicit conversion to" do | ||
|
||
before do | ||
@stack = Hamster.stack("D", "C", "B", "A") | ||
end | ||
|
||
it "block parameters" do | ||
def func(&block) | ||
yield(@stack) | ||
end | ||
func do |a, b, *c| | ||
a.should == "A" | ||
b.should == "B" | ||
c.should == ["C", "D"] | ||
end | ||
end | ||
|
||
it "method arguments" do | ||
def func(a, b, *c) | ||
a.should == "A" | ||
b.should == "B" | ||
c.should == ["C", "D"] | ||
end | ||
func(*@stack) | ||
end | ||
|
||
it "works with splat" do | ||
array = *@stack | ||
array.should == ["A", "B", "C", "D"] | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
end |
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
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
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