Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Platform specific specs in MSpec, itself?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Luis Lavena  
View profile  
 More options Jul 23 2010, 9:55 pm
From: Luis Lavena <luislav...@gmail.com>
Date: Fri, 23 Jul 2010 22:55:39 -0300
Local: Fri, Jul 23 2010 9:55 pm
Subject: Platform specific specs in MSpec, itself?
Hello guys,

As mentioned before, I'm trying to get all the specs of mspec pass
before jumping in some RubySpec checks.

I found the following specs in fs_spec.rb

  it "removes a symlink" do
    File.symlink @topfile, @link
    rm_r @link
    File.exists?(@link).should be_false
  end

  it "removes a socket" do
    require 'socket'
    UNIXServer.new(@socket).close
    rm_r @socket
    File.exists?(@socket).should be_false
  end

Those two are very platform specific, as neither Ruby on Windows or JRuby work:

C:\Users\Luis\Projects\oss\mspec>ruby -v
ruby 1.8.7 (2010-06-23 patchlevel 299) [i386-mingw32]

2)
NotImplementedError in 'Object#rm_r removes a symlink'
symlink() function is unimplemented on this machine
C:/Users/Luis/Projects/oss/mspec/spec/helpers/fs_spec.rb:142:in `symlink'
C:/Users/Luis/Projects/oss/mspec/spec/helpers/fs_spec.rb:142

3)
NameError in 'Object#rm_r removes a socket'
uninitialized constant UNIXServer
C:/Users/Luis/Projects/oss/mspec/spec/helpers/fs_spec.rb:149

C:\Users\Luis\Projects\oss\mspec>jruby -v
jruby 1.5.1 (ruby 1.8.7 patchlevel 249) (2010-06-06 f3a3480) (Java
HotSpot(TM) Client VM 1.6.0_18) [x86-java]

3)
NotImplementedError in 'Object#rm_r removes a symlink'
symlink() function is unimplemented on this machine
C:/Users/Luis/Projects/oss/mspec/spec/helpers/fs_spec.rb:142

4)
NameError in 'Object#rm_r removes a socket'
uninitialized constant UNIXServer
C:/Users/Luis/Projects/oss/mspec/spec/helpers/fs_spec.rb:149

A simple approach will be usage of platform_is_not around it, but that
seems chicken-egg-dinosaur for me.

Thoughts?
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Ford  
View profile  
 More options Jul 24 2010, 2:03 pm
From: Brian Ford <bri...@gmail.com>
Date: Sat, 24 Jul 2010 11:03:34 -0700 (PDT)
Local: Sat, Jul 24 2010 2:03 pm
Subject: Re: Platform specific specs in MSpec, itself?
Hi Luis,

You're right, it is a bit of a chicken and egg problem, but we have to
be able to account for Windows differences in the specs. Also, the
platform dependent helper functionality should not involve the code
for platform guards and vice versa.

So for now, let's just use the mspec platform guards in the mspec
specs as necessary. If we run into problems, we can revisit this.

I've pushed fixes to 3 of the 4 failures I had in the mspec specs on
Windows. The fourth failure involves Enumerator not being defined at
top level. This should be defined in 1.8.7+ and I'm using your
installation of 1.8.7p249. Would you be able to track down whether
this is a bug in the Windows version?

Cheers,
Brian

On Jul 23, 6:55 pm, Luis Lavena <luislav...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luis Lavena  
View profile  
 More options Jul 24 2010, 2:11 pm
From: Luis Lavena <luislav...@gmail.com>
Date: Sat, 24 Jul 2010 15:11:16 -0300
Local: Sat, Jul 24 2010 2:11 pm
Subject: Re: Platform specific specs in MSpec, itself?

On Sat, Jul 24, 2010 at 3:03 PM, Brian Ford <bri...@gmail.com> wrote:
> Hi Luis,

> You're right, it is a bit of a chicken and egg problem, but we have to
> be able to account for Windows differences in the specs. Also, the
> platform dependent helper functionality should not involve the code
> for platform guards and vice versa.

> So for now, let's just use the mspec platform guards in the mspec
> specs as necessary. If we run into problems, we can revisit this.

> I've pushed fixes to 3 of the 4 failures I had in the mspec specs on
> Windows.

You fixes differ from mine, which I forgot to push :-P

I used fmode helper for the IO and used Regexp.escape instead of using
inspect due the quotes around it.

both worked without issues on windows and linux.

here is the gist:

http://gist.github.com/488868

> The fourth failure involves Enumerator not being defined at
> top level. This should be defined in 1.8.7+ and I'm using your
> installation of 1.8.7p249. Would you be able to track down whether
> this is a bug in the Windows version?

Investigating this. Will push a fix if needed.

Thank you.
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luis Lavena  
View profile  
 More options Jul 24 2010, 2:34 pm
From: Luis Lavena <luislav...@gmail.com>
Date: Sat, 24 Jul 2010 15:34:56 -0300
Local: Sat, Jul 24 2010 2:34 pm
Subject: Re: Platform specific specs in MSpec, itself?

On Sat, Jul 24, 2010 at 3:11 PM, Luis Lavena <luislav...@gmail.com> wrote:

>> The fourth failure involves Enumerator not being defined at
>> top level. This should be defined in 1.8.7+ and I'm using your
>> installation of 1.8.7p249. Would you be able to track down whether
>> this is a bug in the Windows version?

> Investigating this. Will push a fix if needed.

Interesting:

Specs says:

  ruby_version_is '1.8.7' do
    it "returns Enumerator in Ruby 1.8.7+" do
      enumerator_class.should == Enumerator
    end
  end

but enumerator_class is this:

  def enumerator_class
    SpecVersion.new(RUBY_VERSION) < "1.9" ? Enumerable::Enumerator : Enumerator
  end

Which will always return Enumerable::Enumerator with Ruby < 1.9

Checking directly with Ruby:

C:\Users\Luis\Projects\oss\mspec>ruby -ve "puts
$LOADED_FEATURES.inspect; puts Enumerable::Enumerator"
ruby 1.8.7 (2010-06-23 patchlevel 299) [i386-mingw32]
["enumerator.so"]
Enumerable::Enumerator

Is Enumerable::Enumerator,

And the spec also fails on Linux:

[ruby-1.8.7-p174] luis@ubuntu86:~/src/mspec$ spec
spec/helpers/enumerator_class_spec.rb
F

1)
NameError in '#enumerator_class returns Enumerator in Ruby 1.8.7+'
uninitialized constant Enumerator
./spec/helpers/enumerator_class_spec.rb:17:

Seems to me the spec is wrong?
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Ford  
View profile  
 More options Jul 24 2010, 5:27 pm
From: Brian Ford <bri...@gmail.com>
Date: Sat, 24 Jul 2010 14:27:03 -0700 (PDT)
Local: Sat, Jul 24 2010 5:27 pm
Subject: Re: Platform specific specs in MSpec, itself?
Hi Luis,

On Jul 24, 11:34 am, Luis Lavena <luislav...@gmail.com> wrote:

> On Sat, Jul 24, 2010 at 3:11 PM, Luis Lavena <luislav...@gmail.com> wrote:

> >> The fourth failure involves Enumerator not being defined at
> >> top level. This should be defined in 1.8.7+ and I'm using your
> >> installation of 1.8.7p249. Would you be able to track down whether
> >> this is a bug in the Windows version?

> > Investigating this. Will push a fix if needed.

Your fixes were good. Thanks for pushing them.

Yep, the spec was wrong. I've pushed a fix.

Cheers,
Brian


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »