Sha256: 970899e9b99b4d1b30447e898e3309bb49fc600b02bc86ecf6c86d108b7fb67b

Contents?: true

Size: 630 Bytes

Versions: 19

Compression:

Stored size: 630 Bytes

Contents

# spec for picking most-recent or highest-scoring rows
#
# something like:
#   select * from rows group by col_a having col_b = max(col_b)
#
# usage: masticate maxrows --by col_a --max col_b

require "spec_helper"
require "tempfile"

describe "maxrows" do
  it "should find " do
    filename = File.dirname(__FILE__) + "/../data/events.csv"
    tmp = Tempfile.new('maxrows')
    results = Masticate.maxrows(filename, :output => tmp, :by => 'uid', :max => 'timestamp')
    output = File.read(tmp)
    correct_output = File.read(File.dirname(__FILE__) + "/../data/events_reduced.csv")

    output.should == correct_output
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
masticate-0.6.2 spec/lib/maxrow_spec.rb
masticate-0.6.1 spec/lib/maxrow_spec.rb
masticate-0.6.0 spec/lib/maxrow_spec.rb
masticate-0.5.1 spec/lib/maxrow_spec.rb
masticate-0.5.0 spec/lib/maxrow_spec.rb
masticate-0.4.2 spec/lib/maxrow_spec.rb
masticate-0.4.1 spec/lib/maxrow_spec.rb
masticate-0.4.0 spec/lib/maxrow_spec.rb
masticate-0.3.2 spec/lib/maxrow_spec.rb
masticate-0.3.1 spec/lib/maxrow_spec.rb
masticate-0.3 spec/lib/maxrow_spec.rb
masticate-0.2.3 spec/lib/maxrow_spec.rb
masticate-0.2.2 spec/lib/maxrow_spec.rb
masticate-0.2.1 spec/lib/maxrow_spec.rb
masticate-0.2 spec/lib/maxrow_spec.rb
masticate-0.1.5 spec/lib/maxrow_spec.rb
masticate-0.1.4 spec/lib/maxrow_spec.rb
masticate-0.1.3 spec/lib/maxrow_spec.rb
masticate-0.1.1 spec/lib/maxrow_spec.rb