Sha256: 8d7ca1e0d275e225bfd0ab02ec9641beb728b0fd3c5abfbc20b27bbd16c45313

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

require 'helper'

module Nutella
  
  class TestRunList < MiniTest::Test
    
    def setup
      Nutella.runlist.send(:removeRunListFile)
    end
    
    should "return true if the list is empty" do
      assert Nutella.runlist.empty?
    end

    should "return false if the list is not empty" do
      refute_nil Nutella.runlist.add? "run1"
      refute Nutella.runlist.empty?
    end

    should "return empty array if the list is empty" do
      assert_empty Nutella.runlist.to_a
    end

    should "return an array of runs in the list if not empty" do
      refute_nil Nutella.runlist.add? "run1"
      refute_nil Nutella.runlist.add? "run2"
      assert_equal ["run1", "run2"], Nutella.runlist.to_a
    end
    
    should "return nil if trying to add the same element twice" do
      refute_nil Nutella.runlist.add? "run1"
      assert_nil Nutella.runlist.add? "run1"
    end
    
    should "return properly when deleting an item" do
      refute_nil Nutella.runlist.add? "run1"
      refute_nil Nutella.runlist.delete? "run1"
      assert_nil Nutella.runlist.delete? "run1"
    end
    
    def teardown
      Nutella.runlist.send(:removeRunListFile)
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nutella_framework-0.1.2 test/config/test_runlist.rb
nutella_framework-0.1.0 test/config/test_runlist.rb