Sha256: ef51b500c204a9219d3dc3602be46615f5efbe5e277951b9d12c30e92c2e690a

Contents?: true

Size: 1.53 KB

Versions: 188

Compression:

Stored size: 1.53 KB

Contents

require 'minitest/autorun'
require_relative 'octal'

class OctalTest < Minitest::Test
  def test_octal_1_is_decimal_1
    assert_equal 1, Octal.new('1').to_decimal
  end

  def test_octal_10_is_decimal_8
    skip
    assert_equal 8, Octal.new('10').to_decimal
  end

  def test_octal_17_is_decimal_15
    skip
    assert_equal 15, Octal.new('17').to_decimal
  end

  def test_octal_11_is_decimal_9
    skip
    assert_equal 9, Octal.new('11').to_decimal
  end

  def test_octal_130_is_decimal_88
    skip
    assert_equal 88, Octal.new('130').to_decimal
  end

  def test_octal_2047_is_decimal_1063
    skip
    assert_equal 1063, Octal.new('2047').to_decimal
  end

  def test_octal_7777_is_decimal_4095
    skip
    assert_equal 4095, Octal.new('7777').to_decimal
  end

  def test_octal_1234567_is_decimal_342391
    skip
    assert_equal 342_391, Octal.new('1234567').to_decimal
  end

  def test_invalid_octal_is_decimal_0
    skip
    assert_equal 0, Octal.new('carrot').to_decimal
  end

  def test_8_is_seen_as_invalid_and_returns_0
    skip
    assert_equal 0, Octal.new('8').to_decimal
  end

  def test_9_is_seen_as_invalid_and_returns_0
    skip
    assert_equal 0, Octal.new('9').to_decimal
  end

  def test_6789_is_seen_as_invalid_and_returns_0
    skip
    assert_equal 0, Octal.new('6789').to_decimal
  end

  def test_abc1z_is_seen_as_invalid_and_returns_0
    skip
    assert_equal 0, Octal.new('abc1z').to_decimal
  end

  def test_valid_octal_formatted_string_011_is_decimal_9
    skip
    assert_equal 9, Octal.new('011').to_decimal
  end
end

Version data entries

188 entries across 188 versions & 1 rubygems

Version Path
trackler-2.2.1.38 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.37 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.36 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.35 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.34 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.33 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.32 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.31 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.30 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.29 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.28 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.27 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.26 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.25 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.24 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.23 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.22 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.21 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.20 tracks/ruby/exercises/octal/octal_test.rb
trackler-2.2.1.19 tracks/ruby/exercises/octal/octal_test.rb