-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add one test for indent/ooc.vim and .travis.yml
- Loading branch information
1 parent
ec3897b
commit 14e7099
Showing
6 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
language: ruby | ||
rvm: | ||
- 1.9.3 | ||
before_install: sudo apt-get install vim-gtk | ||
before_script: | ||
- "export DISPLAY=:99.0" | ||
- "sh -e /etc/init.d/xvfb start" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'vimrunner', '~> 0.3.0' | ||
gem 'rspec', '~> 2.14.1' | ||
gem 'rake', '~> 10.1.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
diff-lcs (1.2.5) | ||
rake (10.1.0) | ||
rspec (2.14.1) | ||
rspec-core (~> 2.14.0) | ||
rspec-expectations (~> 2.14.0) | ||
rspec-mocks (~> 2.14.0) | ||
rspec-core (2.14.7) | ||
rspec-expectations (2.14.4) | ||
diff-lcs (>= 1.1.3, < 2.0) | ||
rspec-mocks (2.14.4) | ||
vimrunner (0.3.0) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
rake (~> 10.1.0) | ||
rspec (~> 2.14.1) | ||
vimrunner (~> 0.3.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require 'rspec/core/rake_task' | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task :default => :spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
require 'spec_helper' | ||
|
||
describe 'indent/ooc.vim' do | ||
describe 'Basic block behavior' do | ||
specify 'blocks such as classes, funcs, should be indented correctly' do | ||
write_file('test.ooc', <<-EOF) | ||
Dog: class { | ||
init: func { | ||
a: Int | ||
} | ||
} | ||
EOF | ||
|
||
vim.edit 'test.ooc' | ||
do_indent(vim) | ||
|
||
IO.read('test.ooc').rstrip.should eq normalize_string_indent(<<-EOF) | ||
Dog: class { | ||
init: func { | ||
a: Int | ||
} | ||
} | ||
EOF | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require 'vimrunner' | ||
require 'vimrunner/rspec' | ||
|
||
Vimrunner::RSpec.configure do |config| | ||
# Use a single Vim instance for the test suite | ||
config.reuse_server = true | ||
|
||
config.start_vim do | ||
vim = Vimrunner.start_gvim | ||
|
||
# Load ooc indentation | ||
plugin_path = File.expand_path('../..', __FILE__) | ||
vim.add_plugin(plugin_path, 'indent/ooc.vim') | ||
|
||
vim | ||
end | ||
end | ||
|
||
# indent | ||
def do_indent(vim) | ||
vim.set('ft', 'ooc') | ||
vim.normal "ggvG=" # go to beginning, indent all | ||
vim.write | ||
end | ||
|