Skip to content

Commit

Permalink
fixed testing error on ruby 2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
tdtds committed Nov 14, 2014
1 parent bbb11ac commit 12dd349
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: ruby
rvm:
- 2.1.0
- 2.1.5
# NOTE the build step is required to run the tests
script: bundle exec rake build test
2 changes: 1 addition & 1 deletion lib/kindlegen/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Kindlegen
VERSION = '2.9.3.1'
VERSION = '2.9.4' unless const_defined?(:VERSION)
end
6 changes: 3 additions & 3 deletions test/test_kindlegen.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'test/unit'
require 'rubygems/installer'
require 'rubygems/uninstaller'
KINDLEGEN_PROJECT_DIR = File.expand_path(File.dirname(File.dirname(__FILE__)))
$:.delete(File.join(KINDLEGEN_PROJECT_DIR, 'lib'))
Expand All @@ -8,12 +9,11 @@ def test_gem_install
kindlegen_lib_dir = nil
gem_version = File.read(File.join(KINDLEGEN_PROJECT_DIR, 'lib/kindlegen/version.rb')).match(/VERSION = ["'](.*?)["']/)[1]
gem_file = File.join(KINDLEGEN_PROJECT_DIR, 'pkg', %(kindlegen-#{gem_version}.gem))
result = Gem.install gem_file
result = Gem::Installer.new(gem_file).install
begin
require 'kindlegen'
rescue ::LoadError
kindlegen_lib_dir = ::File.join(result[0].gem_dir, 'lib')
$:.unshift kindlegen_lib_dir
$:.unshift result.lib_dirs_glob
require 'kindlegen'
end
output = %x(#{Kindlegen.command})
Expand Down

0 comments on commit 12dd349

Please sign in to comment.