开发者

How to include library in rubymine unit tests

开发者 https://www.devze.com 2023-03-06 13:01 出处:网络
I have an Rails 3 App, here i have a unit test in test/unit/test.rb require \"test/unit\" require \"lib/feeder\"

I have an Rails 3 App, here i have a unit test in test/unit/test.rb

require "test/unit"
require "lib/feeder"

class LinkParserTest < Test::Unit::TestCase

  def test_with_single_host
    **some code**
  开发者_StackOverflow  assert_equal(links,Feeder.link_parser(entry_summary,host))
  end

if i run test in console by using ruby -I. test/unit/link_parser_test.rb command everything works perfectly but if i run test in RubyMine it says require: no such file to load -- lib/feeder (LoadError)

what i am doing wrong?


got it, rubymine runing ruby -Itest test/unit/link_parser_test.rb command (so it starts in test folder) i had to change require to require "./lib/feeder" and it works normaly

0

精彩评论

暂无评论...
验证码 换一张
取 消