Sha256: b1e40f6054148c956ecad6af6e2e0a7cf40496b5728bfbfa7c15875ecda458fa

Contents?: true

Size: 1.16 KB

Versions: 14

Compression:

Stored size: 1.16 KB

Contents

require File.dirname(__FILE__) << "/test_helper"

class SessionTest < Test::Unit::TestCase
  
  attr_reader :session

  context "Session" do

    setup do
      mock!
      @session = Session.new(@configuration)
    end

    should "start reporter in background by default" do
      session.start
      assert session.reporter.started?
      assert session.reporter.background?
    end
    
    should "optionally start reporter in foreground" do
      session.start(false)
      assert session.reporter.started?
      assert session.reporter.foreground?
    end
    
    context "data" do
      should "have right number of metrics" do
        assert_equal @metrics.size, session.data.size
      end
    end
    
    context "info" do
      should "have metric_infos" do
        assert_kind_of Array, session.info[:metric_infos]
        assert_equal @metrics.size, session.info[:metric_infos].size
      end
      should "have recipes" do
        assert_kind_of Array, session.info[:recipes]
        session.info[:recipes].each do |recipe|
          assert_kind_of String, recipe[:name]
          assert_kind_of String, recipe[:url]
        end          
      end
      
    end

  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fiveruns-dash-ruby-0.7.0 test/session_test.rb
fiveruns-dash-ruby-0.7.1 test/session_test.rb
fiveruns-dash-ruby-0.7.2 test/session_test.rb
fiveruns-dash-ruby-0.7.3 test/session_test.rb
fiveruns-dash-ruby-0.7.4 test/session_test.rb
fiveruns-dash-ruby-0.7.5 test/session_test.rb
fiveruns-dash-ruby-0.7.6 test/session_test.rb
fiveruns-dash-ruby-0.8.0 test/session_test.rb
fiveruns-dash-ruby-0.8.1 test/session_test.rb
fiveruns-dash-ruby-0.8.3 test/session_test.rb
fiveruns-dash-ruby-0.8.4 test/session_test.rb
fiveruns-dash-ruby-0.8.5 test/session_test.rb
fiveruns-dash-ruby-0.8.6 test/session_test.rb
fiveruns-dash-ruby-0.8.8 test/session_test.rb