Cosmetic refactoring

* Changed the API calls to be more sensible & simple and free of
  redundancy.
This commit is contained in:
Dhruva Sagar
2014-04-25 11:09:14 +05:30
parent cfbac6979d
commit 43d0c0ff6f
9 changed files with 92 additions and 92 deletions

View File

@@ -54,7 +54,7 @@ describe 'cell'
before
new
normal! ggdG
call tablemode#TableModeEnable()
call tablemode#Enable()
normal i|test11|test12|
|test21|test22|
call cursor(1, 3)
@@ -95,7 +95,7 @@ describe 'cell'
describe 'up or down'
before
new
normal! ggdG
normal! ggdG
call tablemode#Enable()
normal i|test11|test12|
|test21|test22|

View File

@@ -5,39 +5,39 @@ call vspec#hint({'scope': 'tablemode#table#scope()', 'sid': 'tablemode#table#sid
describe 'table'
describe 'API'
describe 'IsATableRow'
describe 'IsRow'
before
new
read t/fixtures/sample.txt
end
it 'should return true when inside a table'
Expect tablemode#table#IsATableRow(2) to_be_true
Expect tablemode#table#IsATableRow(3) to_be_true
Expect tablemode#table#IsRow(2) to_be_true
Expect tablemode#table#IsRow(3) to_be_true
end
it 'should return false when outside a table'
Expect tablemode#table#IsATableRow(1) to_be_false
Expect tablemode#table#IsATableRow(4) to_be_false
Expect tablemode#table#IsRow(1) to_be_false
Expect tablemode#table#IsRow(4) to_be_false
end
end
describe 'IsATableHeader'
describe 'IsHeader'
before
new
read t/fixtures/sample_with_header.txt
end
it 'should return true when on a table header'
Expect tablemode#table#IsATableHeader(3) to_be_true
Expect tablemode#table#IsATableHeader(6) to_be_true
Expect tablemode#table#IsHeader(3) to_be_true
Expect tablemode#table#IsHeader(6) to_be_true
end
it 'should return false when not on a table header'
Expect tablemode#table#IsATableHeader(1) to_be_false
Expect tablemode#table#IsATableHeader(2) to_be_false
Expect tablemode#table#IsATableHeader(4) to_be_false
Expect tablemode#table#IsATableHeader(5) to_be_false
Expect tablemode#table#IsHeader(1) to_be_false
Expect tablemode#table#IsHeader(2) to_be_false
Expect tablemode#table#IsHeader(4) to_be_false
Expect tablemode#table#IsHeader(5) to_be_false
end
end
end

View File

@@ -5,9 +5,9 @@ call vspec#hint({'scope': 'tablemode#scope()', 'sid': 'tablemode#sid()'})
describe 'tablemode'
describe 'Activation'
describe 'tablemode#TableModeEnable()'
describe 'tablemode#Enable()'
before
call tablemode#TableModeEnable()
call tablemode#Enable()
end
it 'should enable table mode'
@@ -15,9 +15,9 @@ describe 'tablemode'
end
end
describe 'tablemode#TableModeDisable()'
describe 'tablemode#Disable()'
before
call tablemode#TableModeDisable()
call tablemode#Disable()
end
it 'should disable table mode'
@@ -25,11 +25,11 @@ describe 'tablemode'
end
end
describe 'tablemode#TableModeToggle()'
describe 'tablemode#Toggle()'
it 'should toggle table mode'
call tablemode#TableModeToggle()
call tablemode#Toggle()
Expect b:table_mode_active to_be_true
call tablemode#TableModeToggle()
call tablemode#Toggle()
Expect b:table_mode_active to_be_false
end
end
@@ -43,14 +43,14 @@ describe 'tablemode'
it 'should tableize with default delimiter'
:2,3call tablemode#TableizeRange('')
Expect tablemode#table#IsATableRow(2) to_be_true
Expect tablemode#table#IsRow(2) to_be_true
Expect tablemode#spreadsheet#RowCount(2) == 2
Expect tablemode#spreadsheet#ColumnCount(2) == 3
end
it 'should tableize with given delimiter'
:2,3call tablemode#TableizeRange('/;')
Expect tablemode#table#IsATableRow(2) to_be_true
Expect tablemode#table#IsRow(2) to_be_true
Expect tablemode#spreadsheet#RowCount(2) == 2
Expect tablemode#spreadsheet#ColumnCount(2) == 2
end