Add first pass

This commit is contained in:
Jeremy Walker
2023-09-20 15:04:24 +02:00
commit d08fcf62b9
7 changed files with 365 additions and 0 deletions

85
test/mixed_test.rb Normal file
View File

@@ -0,0 +1,85 @@
require 'test_helper'
class MixedTest < Minitest::Test
def test_three_then_four_then_three
input = <<~INPUT
something
```exercism/note
code 1
```
````exercism/note
code 2
````
```exercism/note
code 3
```
end bit
INPUT
output = <<~OUTPUT
something
~~~~exercism/note
code 1
~~~~
~~~~exercism/note
code 2
~~~~
~~~~exercism/note
code 3
~~~~
end bit
OUTPUT
assert_equal output, AdmonitionBlockFormatter.format(input)
end
def test_four_then_three_then_four
input = <<~INPUT
something
````exercism/note
code 1
````
```exercism/note
code 2
```
````exercism/note
code 3
````
end bit
INPUT
output = <<~OUTPUT
something
~~~~exercism/note
code 1
~~~~
~~~~exercism/note
code 2
~~~~
~~~~exercism/note
code 3
~~~~
end bit
OUTPUT
assert_equal output, AdmonitionBlockFormatter.format(input)
end
end