Unable to find plugins when unit testing using rspec on windows 10

Hi

Using logstash 2.3.1, after having run the "logstash-plugin install --development", the gemfile is updated and i can find the plugins manually.

The top of the ruby file containing the test contain the following lines:

require "logstash/devutils/rspec/spec_helper"
require "logstash/filters/multiline"
require "logstash/filters/grok"
require "logstash/filters/date"
require "logstash/filters/mutate"
require 'rspec/expectations'
...

When running the test i get the following error:

LoadError: no such file to load -- logstash/devutils/rspec/spec_helper

I have confirmed that the spec_helper exists both in the filestructure and the gemfile. Furthermore, it works on windows 8 with no problem.

My assumption at this point is, that an environmental value doesn't get set properly when installing the plugins when using windows 10.

I hope someone can help me. If more information is needed i will happily supply.

Best regards
Christoffer

Hello

I found a solution. Apparently the lookup paths for gems did not get set properly.

By adding the following three lines at the top of the test file (before requires), the path was set and i could access the logstash-devutils and subsequent plugins

$LOAD_PATH.unshift(File.expand_path(File.join(__FILE__, "..","..","..","lib" )))
require "bootstrap/environment"
Gem.use_paths(LogStash::Environment.logstash_gem_home)
...

The load path assumes that the test file is at

<logstash-folder>/bin/<test-folder>/

if the test file is somewhere else the LOAD_PATH must be set to point to the /lib/ folder

I hope this helps someone

Best regards
Christoffer