Sha256: 038db5f3c3e3dc8d9317fa07d84339ed8672acfcc03ae19a9c697f45f8ab297b

Contents?: true

Size: 983 Bytes

Versions: 4

Compression:

Stored size: 983 Bytes

Contents

require 'helper'
require 'bubble_sort/algorithm_bubble_sort'

class TestAlgorithm < Test::Unit::TestCase
  
  context "AlgorithmBubbleSort" do
    
    should "be a acceptable algorithm" do
      
      bubble_sort = AlgorithmBubbleSort.new
      
      assert_equal bubble_sort.test_suites.length, 1
      
      assert_equal 2, bubble_sort.implementations.length
      assert bubble_sort.implementations[0]
      assert_equal 'c++', bubble_sort.implementations[0].name
      assert_equal 'c++', bubble_sort.implementations[0].information[:language]
      assert_equal 'Simple implementation in C++', bubble_sort.implementations[0].information[:comment]
      assert bubble_sort.implementations[0].compiler
      
      assert_equal 2, bubble_sort.build.length
      assert_equal 2, bubble_sort.run.length
      
    end
    
  end
  
  context "Algorithm class" do
    should "have only one algorithm" do
      assert_equal 1, Jeka::Algorithm.algorithms.length
    end
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jeka-0.2.3 test/test_algorithm.rb
jeka-0.2.2 test/test_algorithm.rb
jeka-0.2.1 test/test_algorithm.rb
jeka-0.2.0 test/test_algorithm.rb