Skip to content

Commit

Permalink
Require with full file path to mimic rake so that tests pass on Ruby …
Browse files Browse the repository at this point in the history
…1.8.7

Since the require path is different simple_test file will be loaded
twice in Ruby 1.8.7, and the suite then fails with duplicated test names
being defined.

The solution for now is to require the file with full path, which mimics
how rake requires the files and thus only loads it once. This seems to
work with 1.8.7 and 1.9.3, but can be dropped as soon as 1.8.7 support
is removed.
  • Loading branch information
carlosantoniodasilva committed Jul 9, 2014
1 parent de08cd7 commit 267b15b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/backend/memoize_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

require 'backend/simple_test'
# TODO: change back to "require 'backend/simple'" when dropping support to Ruby 1.8.7.
require File.expand_path('../simple_test', __FILE__)

class I18nBackendMemoizeTest < I18nBackendSimpleTest
module MemoizeSpy
Expand Down

0 comments on commit 267b15b

Please sign in to comment.