Sha256: 031d192378fe0d83f5075dd93de4179a5b8291ea36272c5fb23883999ffae5ef

Contents?: true

Size: 763 Bytes

Versions: 14

Compression:

Stored size: 763 Bytes

Contents

require "spec_helper"
require "rack/test/uploaded_file"
require "benchmark"

describe "ActiveMetadata" do

  before(:each) do
    @document = Document.create! { |d| d.name = "John" }
    @document.reload
  end
  
  context "running on mongo" do

    # it "should insert xxx notes" do
    #   notes = 1000000
    #   result = []
    #   Benchmark.bm do |x|
    #     x.report do
    #       notes.times do |i|
    #         start = Time.now
    #         @document.create_note_for(:name, "Note number #{i}")
    #         result.push Time.now - start
    #       end
    #     end  
    #   end  
    #   puts "Total = #{result.sum}"
    #   puts "Average = #{result.sum / notes}"
    #   @document.notes_for(:name).count.should eq notes
    # end
  
 end
 
end


Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
active_metadata-0.5.2 spec/benchmark_spec.rb
active_metadata-0.5.1 spec/benchmark_spec.rb
active_metadata-0.5.0 spec/benchmark_spec.rb
active_metadata-0.4.2 spec/benchmark_spec.rb
active_metadata-0.4.1 spec/benchmark_spec.rb
active_metadata-0.3.2 spec/benchmark_spec.rb
active_metadata-0.3.1 spec/benchmark_spec.rb
active_metadata-0.3.0 spec/benchmark_spec.rb
active_metadata-0.2.4 spec/benchmark_spec.rb
active_metadata-0.2.3 spec/benchmark_spec.rb
active_metadata-0.2.2 spec/benchmark_spec.rb
active_metadata-0.2.1 spec/benchmark_spec.rb
active_metadata-0.2.0 spec/benchmark_spec.rb
active_metadata-0.1.9 spec/benchmark_spec.rb