# Spec changes

**URL:** <https://www.ruby-forum.com/t/spec-changes/142347>\
**Category:** IronRuby\
**Created:** [July 7, 2008, 5:52am UTC](https://www.ruby-forum.com/t/spec-changes/142347 "2008-07-07T05:52:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksunair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b19c9b/32.png) [@ksunair](https://www.ruby-forum.com/u/ksunair)\
**Post date:** [July 7, 2008, 5:52am UTC](https://www.ruby-forum.com/t/spec-changes/142347/1 "2008-07-07T05:52:07Z")

</div>

I think the following spec is wrong for FileOps.dirname  
Â  
It is  
Â  
Â Â Â File.dirname(’/////’).should == ‘/’  
Â  
but it should be  
Â  
Â Â Â File.dirname(’/////’).should == ‘//’  
Â  
If it is my misunderstanding, please let me know.Â  
Â  
Thanks,  
Unni  
Â  
Â

---

<div class="post-metadata">

**Author:** ![ksunair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b19c9b/32.png) [@ksunair](https://www.ruby-forum.com/u/ksunair)\
**Post date:** [July 7, 2008, 9:32am UTC](https://www.ruby-forum.com/t/spec-changes/142347/2 "2008-07-07T09:32:39Z")

</div>

Well, it’s not as simple as that. The spec as written is for \*nix paths,  
where ///// is root. So on one side we should move towards /////  
returning the current drive. On the other hand, the notation //  
represents a UNC file path, which theoretically should resolve to a form  
of //server/share. I don’t know what CRuby wants dirname to return, and  
I also don’t know if we are going to deviate at all. I know that it  
currently returns //, but if you search for this function, there is some  
discussion about how it should behave, and I’m not sure how it resolved.  
For now, I’d suggest turning it into:

```
            platform_is_not :windows do
                            File.dirname('/////').should == '/'
            end
            platform_is :windows do
                            File.dirname('/////').should == '//'
            end

```

That will keep it working on \*nix.

JD

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Unnikrishnan  
Nair  
Sent: Sunday, July 06, 2008 8:51 PM  
To: removed\_email\_address@domain.invalid  
Subject: [Ironruby-core] spec changes

I think the following spec is wrong for FileOps.dirname

It is

```
File.dirname('/////').should == '/'

```

but it should be

```
File.dirname('/////').should == '//'

```

If it is my misunderstanding, please let me know.

Thanks,

Unni

---

<div class="post-metadata">

**Author:** ![ksunair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b19c9b/32.png) [@ksunair](https://www.ruby-forum.com/u/ksunair)\
**Post date:** [July 7, 2008, 6:17pm UTC](https://www.ruby-forum.com/t/spec-changes/142347/3 "2008-07-07T18:17:32Z")

</div>

Hi Unni,  
Did you check this out?

- [http://sparcs.kaist.ac.kr/~tinuviel/download/IronRuby/](http://sparcs.kaist.ac.kr/~tinuviel/download/IronRuby/)
- 

> **[Compiling Mono and IronRuby on OSX Leopard - Ivan Porto Carrero](http://flanders.co.nz/2008/02/05/compiling-mono-and-ironruby-on-osx-leopard/)**
>
> Search form Recent Posts Scalatra 2.2 released Json4s: One AST to rule them all. Typeclass based databinding for scalatra searchable sbt wiki work …

Hope this helps,  
-Jirapong

2008/7/7 Unnikrishnan N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![ksunair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b19c9b/32.png) [@ksunair](https://www.ruby-forum.com/u/ksunair)\
**Post date:** [July 7, 2008, 4:30pm UTC](https://www.ruby-forum.com/t/spec-changes/142347/4 "2008-07-07T16:30:09Z")

</div>

Thanks Jim, I have a test program that I run in windows with all the  
spec against ruby and against IR. It then compare the results and there  
is where I found this problem. yes, you are correct with your change. I  
think we can go with the change suggested.  
By the way, did anyone compiled Ironruby on Mono? I finally got the mono  
installed and would like to try to compile it to run the spec on Mac  
this week. Do you guys consider Mac as \*nix environment?  
Thanks,  
Unni

— On Mon, 7/7/08, Jim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

From: Jim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: RE: [Ironruby-core] spec changes  
To: “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid),  
“removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Date: Monday, July 7, 2008, 1:32 AM

Well, itâ€™s not as simple as that. The spec as written is for \*nix paths,  
where ///// is root. So on one side we should move towards /////  
returning the current drive. On the other hand, the notation //  
represents a UNC file path, which theoretically should resolve to a form  
of //server/share. I donâ€™t know what CRuby wants dirname to return, and  
I also donâ€™t know if we are going to deviate at all. I know that it  
currently returns //, but if you search for this function, there is some  
discussion about how it should behave, and Iâ€™m not sure how it resolved.  
For now, Iâ€™d suggest turning it into:  
Â  
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â platform\_is\_not :windows do  
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â File.dirname(â€˜/////â€™).should == â€˜/â€™  
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â end  
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â platform\_is :windows do  
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â File.dirname(â€˜/////â€™).should == â€˜//â€™  
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â end  
Â  
That will keep it working on \*nix.  
Â  
JD  
Â

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Unnikrishnan  
Nair  
Sent: Sunday, July 06, 2008 8:51 PM  
To: removed\_email\_address@domain.invalid  
Subject: [Ironruby-core] spec changes  
Â

I think the following spec is wrong for FileOps.dirname  
Â  
It is  
Â  
Â Â Â File.dirname(‘/////’).should == ‘/’  
Â  
but it should be  
Â  
Â Â Â File.dirname(‘/////’).should == ‘//’  
Â  
If it is my misunderstanding, please let me know.Â  
Â  
Thanks,  
Unni  
Â  
Â  
Â

---

<div class="post-metadata">

**Author:** ![ksunair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b19c9b/32.png) [@ksunair](https://www.ruby-forum.com/u/ksunair)\
**Post date:** [July 7, 2008, 7:49pm UTC](https://www.ruby-forum.com/t/spec-changes/142347/5 "2008-07-07T19:49:30Z")

</div>

Glad the spec stuff worked.

I have tried to compile IR on Mono, but there are some patches that need  
to be applied first, I’m not sure where those patches are. I also ran  
into a problem on Mac with filename and folder casing not matching the  
csproj file. I would consider Mac as a \*nix platform. It has all the  
stuff I look for (mainly bash, and the UNIX system underneath.

JD

From: Unnikrishnan N. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
Sent: Monday, July 07, 2008 7:18 AM  
To: removed\_email\_address@domain.invalid; Jim D.  
Subject: RE: [Ironruby-core] spec changes

Thanks Jim, I have a test program that I run in windows with all the  
spec against ruby and against IR. It then compare the results and there  
is where I found this problem. yes, you are correct with your change. I  
think we can go with the change suggested.

By the way, did anyone compiled Ironruby on Mono? I finally got the mono  
installed and would like to try to compile it to run the spec on Mac  
this week. Do you guys consider Mac as \*nix environment?

Thanks,

Unni

— On Mon, 7/7/08, Jim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
From: Jim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: RE: [Ironruby-core] spec changes  
To: “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid),  
“removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Date: Monday, July 7, 2008, 1:32 AM  
Well, itâ€™s not as simple as that. The spec as written is for \*nix paths,  
where ///// is root. So on one side we should move towards /////  
returning the current drive. On the other hand, the notation //  
represents a UNC file path, which theoretically should resolve to a form  
of //server/share. I donâ€™t know what CRuby wants dirname to return, and  
I also donâ€™t know if we are going to deviate at all. I know that it  
currently returns //, but if you search for this function, there is some  
discussion about how it should behave, and Iâ€™m not sure how it resolved.  
For now, Iâ€™d suggest turning it into:

```
            platform_is_not :windows do
                            File.dirname(â€˜/////â€™).should == â€˜/â€™
            end
            platform_is :windows do
                            File.dirname(â€˜/////â€™).should == â€˜//â€™
            end

```

That will keep it working on \*nix.

JD

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Unnikrishnan  
Nair  
Sent: Sunday, July 06, 2008 8:51 PM  
To: removed\_email\_address@domain.invalid  
Subject: [Ironruby-core] spec changes

I think the following spec is wrong for FileOps.dirname

It is

```
File.dirname('/////').should == '/'

```

but it should be

```
File.dirname('/////').should == '//'

```

If it is my misunderstanding, please let me know.

Thanks,

Unni

---

<div class="post-metadata">

**Author:** ![ksunair](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b19c9b/32.png) [@ksunair](https://www.ruby-forum.com/u/ksunair)\
**Post date:** [July 7, 2008, 8:06pm UTC](https://www.ruby-forum.com/t/spec-changes/142347/6 "2008-07-07T20:06:29Z")

</div>

Thanks, just to make sure what everÂ changes I make I want to test it  
both in Windows and \*nix world.  
Unni

— On Mon, 7/7/08, Jim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

From: Jim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: RE: [Ironruby-core] spec changes  
To: “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid),  
“removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Date: Monday, July 7, 2008, 11:46 AM

Glad the spec stuff worked.  
Â  
I have tried to compile IR on Mono, but there are some patches that need  
to be applied first, Iâ€™m not sure where those patches are. I also ran  
into a problem on Mac with filename and folder casing not matching the  
csproj file. I would consider Mac as a \*nix platform. It has all the  
stuff I look for (mainly bash, and the UNIX system underneath.  
Â  
JD  
Â

From: Unnikrishnan N. [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
Sent: Monday, July 07, 2008 7:18 AM  
To: removed\_email\_address@domain.invalid; Jim D.  
Subject: RE: [Ironruby-core] spec changes  
Â

Thanks Jim, I have a test program that I run in windows with all the  
spec against ruby and against IR. It then compare the results and there  
is where I found this problem. yes, you are correct with your change. I  
think we can go with the change suggested.  
By the way, did anyone compiled Ironruby on Mono? I finally got the mono  
installed and would like to try to compile it to run the spec on Mac  
this week. Do you guys consider Mac as \*nix environment?  
Thanks,  
Unni

— On Mon, 7/7/08, Jim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

From: Jim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: RE: [Ironruby-core] spec changes  
To: “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid),  
“removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Date: Monday, July 7, 2008, 1:32 AM

Well, itâ€™s not as simple as that. The spec as written is for \*nix paths,  
where ///// is root. So on one side we should move towards /////  
returning the current drive. On the other hand, the notation //  
represents a UNC file path, which theoretically should resolve to a form  
of //server/share. I donâ€™t know what CRuby wants dirname to return, and  
I also donâ€™t know if we are going to deviate at all. I know that it  
currently returns //, but if you search for this function, there is some  
discussion about how it should behave, and Iâ€™m not sure how it resolved.  
For now, Iâ€™d suggest turning it into:  
Â  
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â platform\_is\_not :windows do  
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â File.dirname(â€˜/////â€™).should == â€˜/â€™  
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â end  
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â platform\_is :windows do  
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â File.dirname(â€˜/////â€™).should == â€˜//â€™  
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â end  
Â  
That will keep it working on \*nix.  
Â  
JD  
Â

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Unnikrishnan  
Nair  
Sent: Sunday, July 06, 2008 8:51 PM  
To: removed\_email\_address@domain.invalid  
Subject: [Ironruby-core] spec changes  
Â

I think the following spec is wrong for FileOps.dirname  
Â  
It is  
Â  
Â Â Â File.dirname(‘/////’).should == ‘/’  
Â  
but it should be  
Â  
Â Â Â File.dirname(‘/////’).should == ‘//’  
Â  
If it is my misunderstanding, please let me know.Â  
Â  
Thanks,  
Unni  
Â  
Â  
Â  
Â
