Added fixtures

This commit is contained in:
Dhruva Sagar
2014-04-07 19:09:02 +05:30
parent a0207b7895
commit 943496c535
9 changed files with 21 additions and 15 deletions

View File

@@ -5,14 +5,10 @@ call vspec#hint({'scope': 'tablemode#align#scope()', 'sid': 'tablemode#align#sid
describe 'Align' describe 'Align'
it 'should align table content correctly' it 'should align table content correctly'
let lines = ['| This | is a | table |', '| This | is also | a table |'] Expect tablemode#align#Align(readfile('t/fixtures/align/simple_before.txt')) == readfile('t/fixtures/align/simple_after.txt')
let result = ['| This | is a | table |', '| This | is also | a table |']
Expect tablemode#align#Align(lines) == result
end end
it 'should align table content with unicode characters correctly' it 'should align table content with unicode characters correctly'
let lines = ['| This | is 測試 | table |', '| This | is also | a table |'] Expect tablemode#align#Align(readfile('t/fixtures/align/unicode_before.txt')) == readfile('t/fixtures/align/unicode_after.txt')
let result = ['| This | is 測試 | table |', '| This | is also | a table |']
Expect tablemode#align#Align(lines) == result
end end
end end

View File

@@ -0,0 +1,2 @@
| This | is a | table |
| This | is also | a table |

View File

@@ -0,0 +1,2 @@
|This|is a|table|
|This|is also|a table|

View File

@@ -0,0 +1,2 @@
| This | is 測試 | table |
| This | is also | a table |

View File

@@ -0,0 +1,2 @@
| This | is 測試 | table |
| This | is also | a table |

4
t/fixtures/sample.txt Normal file
View File

@@ -0,0 +1,4 @@
| test11 | test12 |
| test21 | test22 |

4
t/fixtures/tableize.txt Normal file
View File

@@ -0,0 +1,4 @@
asd,asd;asd,asd
asd,asd;asd,asd

View File

@@ -7,9 +7,7 @@ describe 'spreadsheet'
describe 'API' describe 'API'
before before
new new
normal! ggdG read t/fixtures/sample.txt
call tablemode#TableModeEnable()
normal i
end end
it 'should return the row count' it 'should return the row count'
@@ -79,7 +77,6 @@ describe 'spreadsheet'
describe 'Manipulations' describe 'Manipulations'
before before
new new
before
normal i|test11|test12| normal i|test11|test12|
|test21|test22| |test21|test22|
call cursor(1, 3) call cursor(1, 3)

View File

@@ -7,9 +7,7 @@ describe 'table'
describe 'API' describe 'API'
before before
new new
normal! ggdG read t/fixtures/sample.txt
call tablemode#TableModeEnable()
normal i
end end
it 'should return true when inside a table' it 'should return true when inside a table'
@@ -24,8 +22,7 @@ describe 'table'
describe 'Tableize' describe 'Tableize'
before before
new new
before read t/fixtures/tableize.txt
new
end end
it 'should tableize with default delimiter' it 'should tableize with default delimiter'