Unpleasant unboxing experience

9 views
Skip to first unread message

Alex Chaffee

unread,
Dec 23, 2009, 6:29:39 PM12/23/09
to Jasmine, ka...@cohuman.com
My coworker and I just tried to install Jasmine in our Sinatra webapp
and encountered some serious problems with the documentation and code.
I'm sure Jasmine is awesome once you get it rolling but...

Here's some of our troubles:

* The "examples" directory -- to which the readme directs us -- has
two subdirectories, "html" and "ruby" which should really be named
"using a static suite" and "using a jasmine server", right? And in
fact they could be a single directory like you use for testing Jasmine
itself, containing both a static HTML file and the Ruby files.

* jasmine_spec.rb has all this saucelabs stuff all over the place
which is pretty confusing for people who are just trying to get things
going locally. It should be in a separate "using sauce labs" example
directory, or maybe just a howto or library.

* geminstaller fails to find ragaskar-jsdoc_helper and pivotal-
selenium-rc since github isn't serving gems any more. I guess I'll
have to go clone them and try to build gems and install them manually?

* jasmine_spec.rb also has a bug in it -- you need to specify
"localhost" to SeleniumRC::Server.new. This may be because you're
using github's pivotal-selenium-rc.

* Also there's a embarrassing bug in jasmine_runner.rb, repeated
several times in that file:
@browser = options[:browser] ? options[:browser].delete(:browser) :
'firefox'
should be
@browser = options[:browser] ? options.delete(:browser) : 'firefox'

* There's no documentation on how to include our app JS files when
using the server runner (vs. the html page runner). In the HTML suite
files there are <script> lines but where do I load the system under
test?

* Currently I can run the server and get some specs to execute in the
browser, but selenium freezes after bringing up the selenium status
window but before opening the actual runner. I'm thinking maybe this
will get better if I install the different selenium-rc gem...

I have several other questions but I'll wait until I get this running
first. :-)

Merry Christmas!

- Alex

Rajan Agaskar

unread,
Dec 23, 2009, 10:11:35 PM12/23/09
to jasmi...@googlegroups.com, ka...@cohuman.com
Sorry you've had such a bad experience, and thanks for letting us know -- we're trying to make jasmine as usuable as possible for end-users, but we're still rather in the early stages, so there's going to be a bit of turbulence. I've provided some responses below, but I'm not sure we have any 'easy' fixes for you -- it looks like we've got to do a bit of maintenance on the install and doc process. When you've authored a project, solving these sorts of problems seem simple, and sometimes you don't even notice when there's a bump in the road, so your feedback is very valuable to us.
 
On Wed, Dec 23, 2009 at 3:29 PM, Alex Chaffee <ale...@gmail.com> wrote:
My coworker and I just tried to install Jasmine in our Sinatra webapp
and encountered some serious problems with the documentation and code.
I'm sure Jasmine is awesome once you get it rolling but...

Here's some of our troubles:

* The "examples" directory -- to which the readme directs us -- has
two subdirectories, "html" and "ruby" which should really be named
"using a static suite" and "using a jasmine server", right? And in
fact they could be a single directory like you use for testing Jasmine
itself, containing both a static HTML file and the Ruby files.


Noted. I think I'd disagree on a dir name change here, but we could probably resolve this with better documentation. If you're interested, there's also a jasmine-ruby gem on gemcutter (which, WARNING, is in the VERY early stages of development) that might throw up fewer roadblocks for you. It's a little more hands-off, after it is installed.
 
* jasmine_spec.rb has all this saucelabs stuff all over the place
which is pretty confusing for people who are just trying to get things
going locally. It should be in a separate "using sauce labs" example
directory, or maybe just a howto or library.


Saucelabs integration was a recent addition. I have to admit I haven't fully reviewed it, but I didn't see any difference while running test suites/examples, so I expected it to be a non-issue for end-users. We'll take another look at jasmine_spec.
 
* geminstaller fails to find ragaskar-jsdoc_helper and pivotal-
selenium-rc since github isn't serving gems any more. I guess I'll
have to go clone them and try to build gems and install them manually?


I've had one prior complaint about this, but had no issues when I ran geminstaller this morning. I'll take that to mean that my env is either non-standard or (more likely) I've already got the jsdoc and pivotal gems lying around. I usually try to kill all my gems and run gem installer in a clean env but haven't done that for a few weeks. This is something we'll try to get fixed ASAP.
 
* jasmine_spec.rb also has a bug in it -- you need to specify
"localhost" to SeleniumRC::Server.new. This may be because you're
using github's pivotal-selenium-rc.

I haven't seen this yet.... Will I see this issue if I install a diff version of pivotal-selenium-rc?
 

* Also there's a embarrassing bug in jasmine_runner.rb, repeated
several times in that file:
 @browser = options[:browser] ? options[:browser].delete(:browser) :
'firefox'
 should be
 @browser = options[:browser] ? options.delete(:browser) : 'firefox'

OK.
 

* There's no documentation on how to include our app JS files when
using the server runner (vs. the html page runner). In the HTML suite
files there are <script> lines but where do I load the system under
test?


There's a couple different ways to do this ATM. It's possible to pass a list of app files to the ruby server as "spec_helpers". On the other hand, some people have used jasmine.include() to retrieve app files in a spec_helper.js file and set that as the sole spec_helper file. How would you like to include your app js files?
 
* Currently I can run the server and get some specs to execute in the
browser, but selenium freezes after bringing up the selenium status
window but before opening the actual runner. I'm thinking maybe this
will get better if I install the different selenium-rc gem...

I haven't seen this yet, but I'll see what happens when I clear out my gems and try a re-install.
 

I have several other questions but I'll wait until I get this running
first. :-)

Merry Christmas!

 - Alex

--

You received this message because you are subscribed to the Google Groups "Jasmine" group.
To post to this group, send email to jasmi...@googlegroups.com.
To unsubscribe from this group, send email to jasmine-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jasmine-js?hl=en.



Rajan Agaskar

unread,
Dec 24, 2009, 12:34:57 AM12/24/09
to jasmi...@googlegroups.com, ka...@cohuman.com
I've updated the geminstaller and jasmine so it should work with gemcutter gems ....

 FWIW, it seems like it's still possible to download gems from github, even though they will eventually remove gem support. I'm still able to grab pivotal-selenium-rc, for example, if i gem sources -a http://gems.github.com ... Last I checked, github claimed they were providing gem support for another year at least, so in our defense, I thought we had a bit more time to migrate the necessary pieces.

Alex Chaffee

unread,
Dec 24, 2009, 9:37:11 PM12/24/09
to jasmi...@googlegroups.com, ka...@cohuman.com
Thanks for the quick and helpful reply. I must have been acting
hastily when I removed gems.github.com from my sources. One "gem
sources -a http://gems.github.com" and another "sudo geminstaller"
later and I'm getting much further.

>> * jasmine_spec.rb also has a bug in it -- you need to specify
>> "localhost" to SeleniumRC::Server.new. This may be because you're
>> using github's pivotal-selenium-rc.

Looks like you snuck in and fixed this last night. :-)

>> * Currently I can run the server and get some specs to execute in the
>> browser, but selenium freezes after bringing up the selenium status
>> window but before opening the actual runner. I'm thinking maybe this
>> will get better if I install the different selenium-rc gem...

I think that this was caused by the dreaded dylib problem -- Selenium
poisoning makes wild elemental animals fight (Fire Fox vs. Snow
Leopard)... Here's the fix:

cp /usr/lib/libsqlite3.dylib
/Applications/Firefox.app/Contents/MacOS/libsqlite3.dylib

(Make sure not to do that in the wrong direction or you'll hose PAM
and not be able to sudo or log in. I proved this empirically. :-P --
leading to my next tip, "Hold down Command-S at startup to boot into
single user mode.")

> It's possible to pass a list
> of app files to the ruby server as "spec_helpers". On the other hand, some
> people have used jasmine.include() to retrieve app files in a spec_helper.js
> file and set that as the sole spec_helper file.

When you specify these files, do you use file: URLs or do you specify
them relative to the jasmine server root? And if the latter, can I do
something like "/__JASMINE_ROOT__/../../public/js/foo.js"? Or can I
specify an __APP_ROOT__ (better)?


Sorry if I sounded like a grinch yesterday! As penance I'm working on
some of those documentation improvements you said you wanted. Merry
Christmas!

---
Alex Chaffee - al...@cohuman.com - http://alexch.github.com
Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch |
http://alexch.tumblr.com

Chad Woolley

unread,
Dec 25, 2009, 12:59:06 PM12/25/09
to jasmi...@googlegroups.com
On Thu, Dec 24, 2009 at 7:37 PM, Alex Chaffee <ale...@gmail.com> wrote:
> Thanks for the quick and helpful reply. I must have been acting
> hastily when I removed gems.github.com from my sources. One "gem
> sources -a http://gems.github.com" and another "sudo geminstaller"
> later and I'm getting much further.

This should be in the defaults section of geminstaller.yml. Better
yet, switch to Bundler.

Merry Christmas!
-- Chad

Alex Chaffee

unread,
Dec 25, 2009, 1:47:06 PM12/25/09
to jasmi...@googlegroups.com
On Fri, Dec 25, 2009 at 9:59 AM, Chad Woolley <thewoo...@gmail.com> wrote:
> On Thu, Dec 24, 2009 at 7:37 PM, Alex Chaffee <ale...@gmail.com> wrote:
>> Thanks for the quick and helpful reply. I must have been acting
>> hastily when I removed gems.github.com from my sources. One "gem
>> sources -a http://gems.github.com" and another "sudo geminstaller"
>> later and I'm getting much further.
>
> This should be in the defaults section of geminstaller.yml.

I think instead it should be overridden per github gem, as:

install_options: --source=http://gems.github.com

That way the rest of the gems will continue to be found via normal means.

It looks like Rajan updated the selenium-rc gem already; I'll put the
above into my fork for ragaskar-jsdoc_helper.

>  Better yet, switch to Bundler.

I can see providing a bundler manifest -- is that what you mean? Since
Jasmine is meant to be a library more than an application, it's not
clear to me what's the appropriate way to use bundler.

> Merry Christmas!

And to you!

- A

Chad Woolley

unread,
Dec 25, 2009, 2:24:36 PM12/25/09
to jasmi...@googlegroups.com
On Fri, Dec 25, 2009 at 11:47 AM, Alex Chaffee <ale...@gmail.com> wrote:
>  install_options: --source=http://gems.github.com
>
> That way the rest of the gems will continue to be found via normal means.

It is safest to include all sources for all gems in the default
install_options. "Normal means" means falling back on your local
sources, which will break on others' environments, as you found...

> I can see providing a bundler manifest -- is that what you mean? Since
> Jasmine is meant to be a library more than an application, it's not
> clear to me what's the appropriate way to use bundler.

Use it for all gem dependencies - whatever you are currently using
GemInstaller for.

Rajan Agaskar

unread,
Dec 28, 2009, 4:56:42 PM12/28/09
to jasmi...@googlegroups.com, ka...@cohuman.com
Alex:

Glad to hear things are getting better!

Currently, as far as the spec_helpers parameter goes, it takes a relative path that should exist in your jasmine_helper.rb (rack-style) mappings.

Jasmine-ruby makes some modifications to this, and mostly assumes that anything you haven't specified in the mappings should just route from the root path. We're still trying to figure out the right way to do this and to get the two projects in sync, so there will probably be a bit of turbulence here.

Rajan

Reply all
Reply to author
Forward
0 new messages