Sha256: 8589cc3bf3da1102e4a5ece70c5680fc377841fe0b7211cc3fa10565ed2a285b

Contents?: true

Size: 1.25 KB

Versions: 60

Compression:

Stored size: 1.25 KB

Contents

require 'helper'

module Nutella
  
  class TestRunList < MiniTest::Test

    def setup
      @runlist = RunListHash.new( 'runlist.json' )
    end

    should 'return true if the list is empty' do
      assert @runlist.empty?
    end

    should 'return false if the list is not empty' do
      assert @runlist.add?('app_id_a', 'run_id_1', '/just/a/random/path')
      refute @runlist.empty?
    end

    should 'return empty array if the list is empty' do
      assert_empty @runlist.all_runs
    end

    should 'return an array of runs in the list if not empty' do
      refute_nil @runlist.add?( 'app_a', 'run1', '/path/to/my/run1' )
      refute_nil @runlist.add?( 'app_a', 'run2', '/path/to/my/run2' )
      assert_equal %w{run1 run2}, @runlist.runs_for_app('app_a')
    end

    should 'return false if trying to add the same element twice' do
      assert @runlist.add?( 'app_a', 'run1', '/path/to/my/run1' )
      refute @runlist.add?( 'app_a', 'run1', '/path/to/my/run1' )
    end

    should 'return properly when deleting an item' do
      assert @runlist.add?('app_a', 'run1', '/path/to/my/run1' )
      assert @runlist.delete?('app_a', 'run1')
      refute @runlist.delete?('app_a', 'run1')
    end

    def teardown
      @runlist.remove_file
    end

  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
nutella_framework-0.9.2 test/config/test_runlist.rb
nutella_framework-0.9.1 test/config/test_runlist.rb
nutella_framework-0.9.0 test/config/test_runlist.rb
nutella_framework-0.8.0 test/config/test_runlist.rb
nutella_framework-0.7.3 test/config/test_runlist.rb
nutella_framework-0.7.2 test/config/test_runlist.rb
nutella_framework-0.7.1 test/config/test_runlist.rb
nutella_framework-0.7.0 test/config/test_runlist.rb
nutella_framework-0.6.21 test/config/test_runlist.rb
nutella_framework-0.6.20 test/config/test_runlist.rb
nutella_framework-0.6.19 test/config/test_runlist.rb
nutella_framework-0.6.18 test/config/test_runlist.rb
nutella_framework-0.6.17 test/config/test_runlist.rb
nutella_framework-0.6.16 test/config/test_runlist.rb
nutella_framework-0.6.15 test/config/test_runlist.rb
nutella_framework-0.6.13 test/config/test_runlist.rb
nutella_framework-0.6.12 test/config/test_runlist.rb
nutella_framework-0.6.11 test/config/test_runlist.rb
nutella_framework-0.6.10 test/config/test_runlist.rb
nutella_framework-0.6.9 test/config/test_runlist.rb