Sha256: bfe9e72890f5c78ae07fd5a49155cad111d3a1159230c4442b2080e4e032998c

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 KB

Contents

# encoding: utf-8

require 'mojikun/parser'

require 'mojikun/display_node'
require 'mojikun/end_loop_node'
require 'mojikun/loop_node'
require 'mojikun/point_left_node'
require 'mojikun/point_right_node'
require 'mojikun/save_node'
require 'mojikun/thumbs_down_node'
require 'mojikun/thumbs_up_node'

require 'minitest/autorun'

class TestParser < MiniTest::Unit::TestCase
  def test_point_right
    tokens = ["👉"]
    assert_kind_of Mojikun::PointRightNode, Mojikun::Parser.new(tokens).call.first
  end

  def test_point_left
    tokens = ["👈"]
    assert_kind_of Mojikun::PointLeftNode, Mojikun::Parser.new(tokens).call.first
  end

  def test_thumbs_up
    tokens = ["👍"]
    assert_kind_of Mojikun::ThumbsUpNode, Mojikun::Parser.new(tokens).call.first
  end

  def test_thumbs_down
    tokens = ["👎"]
    assert_kind_of Mojikun::ThumbsDownNode, Mojikun::Parser.new(tokens).call.first
  end

  def test_display
    tokens = ["💻"]
    assert_kind_of Mojikun::DisplayNode, Mojikun::Parser.new(tokens).call.first
  end

  def test_save
    tokens = ["💾"]
    assert_kind_of Mojikun::SaveNode, Mojikun::Parser.new(tokens).call.first
  end

  def test_loop
    tokens = ["🔃"]
    assert_kind_of Mojikun::LoopNode, Mojikun::Parser.new(tokens).call.first
  end

  def test_end_loop
    tokens = ["🔙"]
    assert_kind_of Mojikun::EndLoopNode, Mojikun::Parser.new(tokens).call.first
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mojikun-1.0.1 test/parser_test.rb
mojikun-1.0.0 test/parser_test.rb