|
| 1 | +require "spec_helper" |
| 2 | + |
| 3 | +describe "angular vim" do |
| 4 | + |
| 5 | + specify "html tidy syntastic ignores" do |
| 6 | + value_of_variable = vim.echo('g:syntastic_html_tidy_ignore_errors') |
| 7 | + value_of_variable.should eq("[' proprietary attribute \"ng-', ' proprietary attribute \"ui-view', '<div> proprietary attribute \"src']") |
| 8 | + end |
| 9 | + |
| 10 | + specify "run spec command with one spec" do |
| 11 | + write_file('test.js', <<-EOF) |
| 12 | + it('should work', function() { |
| 13 | + var actualThing = 'cow'; |
| 14 | + expect(actualThing).toEqual('cow'); |
| 15 | + }); |
| 16 | + EOF |
| 17 | + |
| 18 | + vim.edit 'test.js' |
| 19 | + vim.command 'AngularRunSpec' |
| 20 | + #vim.write # the AngularRunSpec writes the file |
| 21 | + |
| 22 | + IO.read('test.js').strip.should eq normalize_string_indent(<<-EOF) |
| 23 | + iit('should work', function() { |
| 24 | + var actualThing = 'cow'; |
| 25 | + expect(actualThing).toEqual('cow'); |
| 26 | + }); |
| 27 | + EOF |
| 28 | + end |
| 29 | + |
| 30 | + specify "run spec command with two specs" do |
| 31 | + write_file('test.js', <<-EOF) |
| 32 | + it('should work', function() { |
| 33 | + var actualThing = 'cow'; |
| 34 | + expect(actualThing).toEqual('cow'); |
| 35 | + }); |
| 36 | +
|
| 37 | + it('should also work', function() { |
| 38 | + var actualThing = 'cow'; |
| 39 | + expect(actualThing).toEqual('cow'); |
| 40 | + }); |
| 41 | + EOF |
| 42 | + |
| 43 | + vim.edit 'test.js' |
| 44 | + vim.normal '5j' |
| 45 | + vim.command 'AngularRunSpec' |
| 46 | + |
| 47 | + IO.read('test.js').strip.should eq normalize_string_indent(<<-EOF) |
| 48 | + it('should work', function() { |
| 49 | + var actualThing = 'cow'; |
| 50 | + expect(actualThing).toEqual('cow'); |
| 51 | + }); |
| 52 | +
|
| 53 | + iit('should also work', function() { |
| 54 | + var actualThing = 'cow'; |
| 55 | + expect(actualThing).toEqual('cow'); |
| 56 | + }); |
| 57 | + EOF |
| 58 | + end |
| 59 | + |
| 60 | + specify "run spec command untoggles" do |
| 61 | + write_file('test.js', <<-EOF) |
| 62 | + iit('should work', function() { |
| 63 | + var actualThing = 'cow'; |
| 64 | + expect(actualThing).toEqual('cow'); |
| 65 | + }); |
| 66 | +
|
| 67 | + it('should also work', function() { |
| 68 | + var actualThing = 'cow'; |
| 69 | + expect(actualThing).toEqual('cow'); |
| 70 | + }); |
| 71 | + EOF |
| 72 | + |
| 73 | + vim.edit 'test.js' |
| 74 | + vim.command 'AngularRunSpec' |
| 75 | + |
| 76 | + IO.read('test.js').strip.should eq normalize_string_indent(<<-EOF) |
| 77 | + it('should work', function() { |
| 78 | + var actualThing = 'cow'; |
| 79 | + expect(actualThing).toEqual('cow'); |
| 80 | + }); |
| 81 | +
|
| 82 | + it('should also work', function() { |
| 83 | + var actualThing = 'cow'; |
| 84 | + expect(actualThing).toEqual('cow'); |
| 85 | + }); |
| 86 | + EOF |
| 87 | + end |
| 88 | + |
| 89 | + specify "run spec command grabs focus away from another spec" do |
| 90 | + write_file('test.js', <<-EOF) |
| 91 | + iit('should work', function() { |
| 92 | + var actualThing = 'cow'; |
| 93 | + expect(actualThing).toEqual('cow'); |
| 94 | + }); |
| 95 | +
|
| 96 | + it('should also work', function() { |
| 97 | + var actualThing = 'cow'; |
| 98 | + expect(actualThing).toEqual('cow'); |
| 99 | + }); |
| 100 | + EOF |
| 101 | + |
| 102 | + vim.edit 'test.js' |
| 103 | + vim.normal '5j' |
| 104 | + vim.command 'AngularRunSpec' |
| 105 | + |
| 106 | + IO.read('test.js').strip.should eq normalize_string_indent(<<-EOF) |
| 107 | + it('should work', function() { |
| 108 | + var actualThing = 'cow'; |
| 109 | + expect(actualThing).toEqual('cow'); |
| 110 | + }); |
| 111 | +
|
| 112 | + iit('should also work', function() { |
| 113 | + var actualThing = 'cow'; |
| 114 | + expect(actualThing).toEqual('cow'); |
| 115 | + }); |
| 116 | + EOF |
| 117 | + end |
| 118 | +end |
0 commit comments