Sha256: d923d641c2a4efdc6134f7cbe79dd533cb13c720a99110a18bd6235754548410

Contents?: true

Size: 697 Bytes

Versions: 26

Compression:

Stored size: 697 Bytes

Contents

require 'ceml'

class TestInstructions < Test::Unit::TestCase
  def pi text
    CEML.parse(:instructions, text)
  end

  def assert_bad text
    assert_raise(RuntimeError){ pi text }
  end

  def test_bad
    assert_bad "love your mother"
    assert_bad "tell jim re susan: i hate you"
    assert_bad "tell phil"
    assert_bad "ask susan re clothing"
    assert_bad "ask susan re clothing: "
  end

  def test_instructions
    assert_equal "run to the kitchen", pi('tell joe: run to the kitchen').i_tell([:joe]).text
    assert_equal ["favorite color?", "favorite soup?"], pi(
      "ask joe re color: favorite color?\nask joe re soup: favorite soup?"
    ).i_asks([:joe]).map(&:text)
  end

end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
ceml-0.7.13 test/test_instructions.rb
ceml-0.7.11 test/test_instructions.rb
ceml-0.7.9 test/test_instructions.rb
ceml-0.7.7 test/test_instructions.rb
ceml-0.7.5 test/test_instructions.rb
ceml-0.7.4 test/test_instructions.rb
ceml-0.7.3 test/test_instructions.rb
ceml-0.7.2 test/test_instructions.rb
ceml-0.7.1 test/test_instructions.rb
ceml-0.7.0 test/test_instructions.rb
ceml-0.6.4 test/test_instructions.rb
ceml-0.6.3 test/test_instructions.rb
ceml-0.6.2 test/test_instructions.rb
ceml-0.6.1 test/test_instructions.rb
ceml-0.6.0 test/test_instructions.rb
ceml-0.5.8 test/test_instructions.rb
ceml-0.5.7 test/test_instructions.rb
ceml-0.5.6 test/test_instructions.rb
ceml-0.5.5 test/test_instructions.rb
ceml-0.5.4 test/test_instructions.rb