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
Brad Seefeld
committed
Jun 7, 2011
1 parent
c25f1cd
commit f37200e
Showing
3 changed files
with
24 additions
and
1 deletion.
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,22 @@ | |||
require "spec_helper" | |||
|
|||
describe Rgviz::DataTable::MaxColumn do | |||
|
|||
before(:each) do | |||
@col = Rgviz::DataTable::MaxColumn.new("a", "max(a)") | |||
end | |||
|
|||
it "finds the max column" do | |||
rows = [{"a" => 1}, {"a" => 3}, {"a" => 1}] | |||
@col.evaluate(rows).should == 3 | |||
end | |||
|
|||
it "returns nil when no rows given" do | |||
@col.evaluate([]).should be_nil | |||
end | |||
|
|||
it "returns nil when column does not exist" do | |||
rows = [{"b" => 1}, {"b" => 3}, {"b" => 1}] | |||
@col.evaluate(rows).should be_nil | |||
end | |||
end |