Sha256: ea269f2a8ce871524e204061ed9cab19581b27723ea3e26a16ced928067404a3
Contents?: true
Size: 765 Bytes
Versions: 33
Compression:
Stored size: 765 Bytes
Contents
require File.dirname(__FILE__) + '/spec_helper' module BenchmarkSpec TestValues = { date: Date.today, number: 27, int: 356192, float: 72.362517, bool: true, # boolean: false, # array: [:test1,:test2], json: {test1: true, test2: "false"} } TestData = TestValues.inject({}){|acc,(k,v)| acc["a_#{k}".to_sym] = v; acc } class BenchmarkedObject < RedisObject TestValues.keys.each do |type| send(type.to_sym,"a_#{type}".to_sym) end def aggregate sleep 0.1 42.7 end benchmark :aggregate end describe Seabright::Benchmark do before do RedisObject.store.flushdb end it "benchmarks a call" do obj = BenchmarkedObject.create(TestData) obj.aggregate.should eq(42.7) end end end
Version data entries
33 entries across 33 versions & 1 rubygems