Move class to lib, add sugar, add tests

This commit is contained in:
Alex Sherman 2021-05-20 17:06:34 +05:00
parent 74e3d5461b
commit 45dfa57529
10 changed files with 71 additions and 36 deletions

View file

@ -0,0 +1,16 @@
require 'test_helper'
require 'xsd/util'
class XsdUtilTest < ActiveSupport::TestCase
def test_single_part_name
version = Xsd::Util.call(schema_path: 'test/fixtures/files/schemas', for_prefix: 'abcde')
assert_equal 'abcde-1.2.xsd', version
end
def test_double_part_name
version = Xsd::Util.call(schema_path: 'test/fixtures/files/schemas', for_prefix: 'abcde-fghij')
assert_equal 'abcde-fghij-1.3.xsd', version
end
end