Sha256: 2a3ff6f129a725ce2980a0e0964d85f5a406d1e735ac2a90f880d97eb7291bb9

Contents?: true

Size: 546 Bytes

Versions: 1

Compression:

Stored size: 546 Bytes

Contents

require_relative '../../helper_no_rails'

class RailsDataExplorer
  module Utils
    describe DataBinner do

      describe '#bin' do

        [
          [
            '1',
            [1,2,3],
            [0,1,2,3,4],
            ["1 or less", "1 or less", "2 or less", "3 or less", "> 3"]
          ],
        ].each do |(name, bin_specs, vals, xpect)|

          it "bins #{ name }" do
            db = DataBinner.new(*bin_specs)
            vals.map{ |e| db.bin(e) }.must_equal xpect
          end

        end

      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-data-explorer-0.1.0 spec/rails-data-explorer/utils/data_binner_spec.rb