We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a847f0 commit 2f38b3aCopy full SHA for 2f38b3a
spec/folding/basic_spec.rb
@@ -0,0 +1,34 @@
1
+# frozen_string_literal: true
2
+
3
+require 'spec_helper'
4
5
+RSpec::Matchers.define :fold_lines do |lines|
6
+ file = ".fixture.ex"
7
8
9
+ match do |code|
10
+ File.write(file, code)
11
+ VIM.edit file
12
+ VIM.command("set foldmethod=syntax")
13
14
+ VIM.normal("zO")
15
+ VIM.normal("zM")
16
+ VIM.normal("dd")
17
+ VIM.write
18
19
+ written = IO.read(file)
20
+ code.lines.count - written.lines.count == lines
21
+ end
22
+end
23
24
+describe 'Basic folding' do
25
+ it 'blah' do
26
+ content = <<~EOF
27
+ defmodule M do
28
29
+ EOF
30
31
+ expect(content).to fold_lines(2)
32
33
34
0 commit comments