neovim / neovim-ruby

Ruby support for Neovim
MIT License
340 stars 17 forks source link

Test failure: Neovim::Current#window= sets the current window from an integer #25

Closed jpleau closed 7 years ago

jpleau commented 7 years ago

Hi. With neovim 0.1.7, I get the following test failure after installing the gem (0.3.1)

jason ~/packages/ruby/neovim/ruby-neovim [master*] rspec spec        

Randomized with seed 56265
.....................................F............................................................................................................................................................................................................

Failures:

  1) Neovim::Current#window= sets the current window from an integer
     Failure/Error: err ? raise(ArgumentError, err) : res

     ArgumentError:
       Invalid window id
     # ./lib/neovim/session.rb:102:in `block in request'
     # ./lib/neovim/session.rb:154:in `main_thread_only'
     # ./lib/neovim/session.rb:93:in `request'
     # ./lib/neovim/current.rb:59:in `window='
     # ./spec/neovim/current_spec.rb:76:in `block (4 levels) in <module:Neovim>'
     # ./spec/neovim/current_spec.rb:75:in `block (3 levels) in <module:Neovim>'
     # ./spec/helper.rb:69:in `block (3 levels) in <top (required)>'
     # ./spec/helper.rb:69:in `block (2 levels) in <top (required)>'

Finished in 3.13 seconds (files took 0.16158 seconds to load)
242 examples, 1 failure

Failed examples:

rspec ./spec/neovim/current_spec.rb:71 # Neovim::Current#window= sets the current window from an integer

Randomized with seed 56265
alexgenco commented 7 years ago

Thanks! Looks like the window indices now start from 1000 instead of 0. Updated the test to use relative changes instead of absolute: https://github.com/alexgenco/neovim-ruby/commit/6ed635df885f2cbd5794de4cc523b3bdace9986d.