Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a49887f2a960
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 06396c6d643a
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jan 29, 2016

  1. Copy the full SHA
    86d11fc View commit details
  2. Copy the full SHA
    06396c6 View commit details
Showing with 33 additions and 35 deletions.
  1. +25 −26 spec/regression/GH-1940_symlink_load_path_should_not_expand_in_FILE_spec.rb
  2. +8 −9 spec/regression/GH-2883_date_sec_fraction_spec.rb
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
require 'tmpdir'
require 'fileutils'

if RUBY_VERSION >= '1.9'
describe "A file required from a load path entry with an embedded symlink" do
before :all do
@path = Dir.mktmpdir
@realpath = "#{@path}/real"
@linkpath = "#{@path}/link"
@realfilepath = "#{@realpath}/GH1940_test.rb"
@linkfilepath = "#{@linkpath}/GH1940_test.rb"
Dir.mkdir @realpath
File.symlink @realpath, @linkpath
File.write(@realfilepath, "class GH1940; def self.__file__; __FILE__; end; end")
describe "A file required from a load path entry with an embedded symlink" do

$LOAD_PATH << @linkpath
require "GH1940_test.rb"
end
before :all do

after :all do
FileUtils.rm_rf @realpath
$LOAD_PATH.delete @linkpath
$LOADED_FEATURES.delete @linkfilepath
end
@path = Dir.mktmpdir
@realpath = "#{@path}/real"
@linkpath = "#{@path}/link"
@realfilepath = "#{@realpath}/GH1940_test.rb"
@linkfilepath = "#{@linkpath}/GH1940_test.rb"
Dir.mkdir @realpath
File.symlink @realpath, @linkpath
File.write(@realfilepath, "class GH1940; def self.__file__; __FILE__; end; end")

it "leaves __FILE__ unexpanded" do
expect(GH1940.__file__).to eq(@linkfilepath)
end
$LOAD_PATH << @linkpath
require "GH1940_test.rb"
end

after :all do
FileUtils.rm_rf @realpath
$LOAD_PATH.delete @linkpath
$LOADED_FEATURES.delete @linkfilepath
end

it "leaves LOADED_FEATURES unexpanded" do
skip "fix for #1941"
it "leaves __FILE__ unexpanded" do
expect(GH1940.__file__).to eq(@linkfilepath)
end

expect($LOADED_FEATURES).to include(@linkfilepath)
end
it "leaves LOADED_FEATURES unexpanded" do
expect($LOADED_FEATURES).to include(@linkfilepath)
end

end
17 changes: 8 additions & 9 deletions spec/regression/GH-2883_date_sec_fraction_spec.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
require 'rspec'
require 'date'

# https://github.com/jruby/jruby/issues/2883
describe 'DateTime.iso8601' do

if RUBY_VERSION > '1.9'
describe 'DateTime.iso8601' do
it 'correctly parses fraction of a second' do
date = DateTime.iso8601('2014-07-08T17:51:36.013Z')
expect(date.sec_fraction).to eq(Rational(13, 1000))
expect(date.second_fraction).to eq(Rational(13, 1000))
end
before(:all) { require 'date' }

it 'correctly parses fraction of a second' do
date = DateTime.iso8601('2014-07-08T17:51:36.013Z')
expect(date.sec_fraction).to eq(Rational(13, 1000))
expect(date.second_fraction).to eq(Rational(13, 1000))
end

end