Sha256: 937c59b21dddd8a86a7ca2603e70472d9c2f05799a10c3cea448338746c9abfb

Contents?: true

Size: 1.13 KB

Versions: 43

Compression:

Stored size: 1.13 KB

Contents

$:.unshift File.join(File.dirname(__FILE__))
require 'bench_spec_helper'

describe "UtilsSpec" do
  # it_should_behave_like "BenchSpecHelper"
  include Utils
  include Logging

  it_behaves_like "BenchSpecHelper" do
    it "should compare two identical hashes" do
      h1 = {'key1' => {'key2' => 'value2'}}
      h2 = {'key1' => {'key2' => 'value2'}}
      compare(:expected,h1,:actual,h2).should == []
    end

    it "should compare two different hashes" do
      h1 = {'key1' => {'key2' => 'value2'}}
      h2 = {'key1' => {'key2' => 'value3'}}
      compare(:expected,h1,:actual,h2).should == 
        [{:actual=>"value3", :path=>["key1", "key2"], :expected=>"value2"}]
    end

    it "should compare_and_log two identical hashes" do
      h1 = {'key1' => {'key2' => 'value2'}}
      h2 = {'key1' => {'key2' => 'value2'}}
      Bench::Utils.should_not_receive(:bench_log)
      compare_and_log(h1,h2,'the caller').should == 0
    end

    it "should compare_and_log two different hashes" do
      h1 = {'key1' => {'key2' => 'value2'}}
      h2 = {'key1' => {'key2' => 'value3'}}
      compare_and_log(h1,h2,'the caller').should == 1
    end
  end  
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
rhoconnect-4.0.4 bench/spec/utils_spec.rb
rhoconnect-4.0.3 bench/spec/utils_spec.rb
rhoconnect-4.0.2 bench/spec/utils_spec.rb
rhoconnect-4.0.1 bench/spec/utils_spec.rb
rhoconnect-4.0.0 bench/spec/utils_spec.rb
rhoconnect-4.0.0.beta.24 bench/spec/utils_spec.rb
rhoconnect-3.4.5 bench/spec/utils_spec.rb
rhoconnect-4.0.0.beta.10 bench/spec/utils_spec.rb
rhoconnect-4.0.0.beta.12 bench/spec/utils_spec.rb
rhoconnect-3.4.4 bench/spec/utils_spec.rb
rhoconnect-3.4.3 bench/spec/utils_spec.rb
rhoconnect-3.4.2 bench/spec/utils_spec.rb
rhoconnect-3.3.6 bench/spec/utils_spec.rb
rhoconnect-3.3.5 bench/spec/utils_spec.rb
rhoconnect-3.3.4 bench/spec/utils_spec.rb
rhoconnect-3.3.3 bench/spec/utils_spec.rb
rhoconnect-3.3.2 bench/spec/utils_spec.rb
rhoconnect-3.3.1 bench/spec/utils_spec.rb
rhoconnect-3.3.1.beta4 bench/spec/utils_spec.rb
rhoconnect-3.3.1.beta3 bench/spec/utils_spec.rb