Sha256: 9e86596cbf5e3047d455b5cbb8f075d91ff869d7e93dcd34e7be214c7e1d3e90

Contents?: true

Size: 1.33 KB

Versions: 2

Compression:

Stored size: 1.33 KB

Contents

require 'test_helper'

SVN_HOOKS_CONFIG_PATH = File.dirname(__FILE__) + '/config/svn_hooks.yml'

class TestJira < Test::Unit::TestCase
  def test_simple
    assert_equal 1, 1
  end

  def test_get_issue_number
    jira = JiraHook.new
    assert_nil jira.get_issue_number("helo,ixist", "SB")
    assert_nil jira.get_issue_number("SB:helo,ixist", "SB")
    assert_nil jira.get_issue_number("SB-: helo,ixist", "SB")
    assert_nil jira.get_issue_number("helo,ixSBist", "SB")
    assert_nil jira.get_issue_number("helo,iSB-xist", "SB")
    isn = jira.get_issue_number("SB-1: Test", "SB")
    assert_not_nil isn
    assert_equal "SB-1", isn
    assert_equal "SB-34234", jira.get_issue_number("hello SB-34234", "SB")
    assert_equal "SB-34234", jira.get_issue_number("hello SB-34234abcd", "SB")
    assert_equal "SB-34234", jira.get_issue_number("hello SB-34234", "sb")
    assert_equal "SB-34234", jira.get_issue_number("hello sB-34234abcd", "sb")
    assert_equal "SB-34234", jira.get_issue_number("hello Sb-34234", "SB")
    assert_equal "SB-34234", jira.get_issue_number("hello sB-34234abcd", "Sb")
    assert_equal "SB-34234", jira.get_issue_number("hello Sb-34234", "sb")
    assert_equal "SB-34234", jira.get_issue_number("hello sb-34234abcd", "sB")
  end


  def test_check_jira
    # JiraHook.check_log("tangliqun", "Message-99:hello", 'Message')
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
svn-hook-tools-0.5.8 test/test_jira.rb
svn-hook-tools-0.5.7 test/test_jira.rb