Rspec set-up for Windows 7

97 views
Skip to first unread message

Mr. Kennedy

unread,
Oct 20, 2016, 1:22:00 AM10/20/16
to rspec
Hello,

I've installed RSpec on a win7 lappy (2009 HP i3)

Ruby 2.2.5p319 (2016-04-26 revision 54774) [i386-mingw32]
Rspec 3.5.4
RubyGem 2.6.7
Bundler version 1.13.1

I am following along with the http://rspec.info/ homepage tutorial videos to make sure everything works.
If I am reading the "bowling' demo correctly bin/rspec --format doc should run the specification test file?


Is this specific to a 'Nix system?
I've mimicked the directory structure:
/bin/
  bundler
  htmldiff
  ldiff
  rspec
/lib/
  bowling.rb
/spec/
  bowling_spec.rb
  spec_helper.rb

...and while in the parent project directory when I enter bin/rspec --format doc in PowerShell I get a system window prompt for a text editor:


I'm confused - should I be seeing the Rspec test file results? (I really want to bask in the joy that is green!)



Should I be doing something to this file?

Otherwise I am following along with this tutorial for Rspec on windows: https://www.tutorialspoint.com/rspec/index.htm
...and rspec does work correctly on my win7 system, but I am confused by the http://rspec.info/ homepage tutorial.

Apologies if this is a really dumb question, I just want to make sure that I'm not missing something or using RSpec incorrectly.

Is there a Windows specific set-up demo/tutorial from the RSpec folks I should otherwise be using?

Should I be associating "rspec" with ruby.exe?

Thanks!
Patrick

Mr. Kennedy

unread,
Oct 20, 2016, 2:18:42 AM10/20/16
to rspec
Ah, I think I've got it... I just need to explicitly call ruby:

ruby bin/rspec --format doc

and the test gets run - YaY!

After poking at my Environment Variable Path to make sure ruby.exe was in there (C:\Ruby22\bin) and looking at my Program Defaults - I thought that I could tell win7 to associate any file named "rspec" with ruby.exe (per https://support.microsoft.com/en-us/help/18539/windows-7-change-default-programs - I couldn't actually add file type "extensions" or "protocols" - I could only change them, but .rb and .rbw were in there!) it occurred to me that I just needed to tell ruby to ingest the command... Heh.

Myron Marston

unread,
Oct 20, 2016, 2:48:07 AM10/20/16
to rs...@googlegroups.com
I've never heard of windows users having to do that.  I thought rubygems took care of installing executables in a way that would work on windows without needing to explicitly call ruby.

That said, I last used Windows in 2008 so I really have no idea.  But I do find it surprising.

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+unsubscribe@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/5d7ff2f2-3be4-42ae-9a95-cb20bda58301%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mr. Kennedy

unread,
Oct 20, 2016, 3:10:31 AM10/20/16
to rspec
This brings me to another question, if I were to select ruby.exe to be the default app to open a file with no extension, would it be the default to open all files with no extensions? Is there a way to tell windows to only open files named "rspec" with ruby.exe? Hmmm....

Mr. Kennedy

unread,
Oct 21, 2016, 3:38:00 AM10/21/16
to rspec
On Thursday, October 20, 2016 at 2:48:07 AM UTC-4, Myron Marston wrote:
I've never heard of windows users having to do that.  I thought rubygems took care of installing executables in a way that would work on windows without needing to explicitly call ruby.

That said, I last used Windows in 2008 so I really have no idea.  But I do find it surprising.

Hi Myron,

Thanks, it's good to hear your experience. FWIW, it's a 2009 HP lappy, so, maybe something changed after 2008? Likely it's user error of some type I am unable to resolve, but whatever the case, at least I am functional now... While installing I did hit a wall w/rubygems as I initially had v2.4 installed when I installed Ruby. As I understand, gems 2.4 is broken for windows and I had to upgrade gems to 2.6.7, so maybe something got kinked up with the registry when I tried to install w/2.4?

Once the new MacBook Pros come out I am hoping that I too can say "the last time I used Windows was in 2016".  
Reply all
Reply to author
Forward
0 new messages