spec/pru_spec.rb in pru-0.1.2 vs spec/pru_spec.rb in pru-0.1.3
- old
+ new
@@ -21,11 +21,11 @@
it "maps" do
`echo abc | ./bin/pru 'gsub(/a/,"b")'`.should == "bbc\n"
end
it "selects and reduces" do
- `cat spec/test.txt | ./bin/pru 'include?("abc")' 'size'`.should == "2\n"
+ `cat spec/test.txt | ./bin/pru 'include?("abc")' 'size'`.should == "3\n"
end
it "can open files" do
`echo spec/test.txt | ./bin/pru 'File.read(self)'`.should == File.read('spec/test.txt')
end
@@ -48,9 +48,13 @@
`cat spec/test.txt | ./bin/pru -r 'sum(&:to_i)'`.should == "1212\n"
end
it "can mean" do
`cat spec/test.txt | ./bin/pru -r 'mean(&:to_i)'`.should == "242.4\n"
+ end
+
+ it "can grouped" do
+ `cat spec/test.txt | ./bin/pru -r 'grouped.map{|a,b| b.size }'`.should include("2\n")
end
end
describe 'map and reduce' do
it "selects with empty string and reduces" do