Skip to content

Commit

Permalink
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions spec/ruby/core/dir/fileno_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/common', __FILE__)

describe "Dir#fileno" do

ruby_version_is "2.2" do
platform_is_not :windows do
before :each do
@name = tmp("fileno")
mkdir_p @name
end

after :each do
rm_r @name
end

it "returns the file descriptor of the dir" do
dir = Dir.new(@name)
dir.fileno.should.be_kind_of(Fixnum)
end
end

platform_is :windows do
it "raises an error" do
dir = Dir.new('.')
lambda { dir.fileno }.to raise_error(NotImplementedError)
end
end
end
end

2 comments on commit 96d033d

@chrisseaton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this not go into RubySpec, rather than just Rubinius? Or do all specs go here first and then merged into RubySpec later?

@jc00ke
Copy link
Member Author

@jc00ke jc00ke commented on 96d033d Oct 10, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisseaton it can make its way into RubySpec later, when we sync.

Please sign in to comment.