Skip to content

Conversation

titusfortner
Copy link
Member

This came up as an issue at the selenium conference workshop when the Ruby group couldn't find an easy way to run a single ruby test in the project.

With this code we can run specific spec files within the selenium/rb directory like this:
export WD_SPEC_DRIVER=chrome; rspec spec/integration/selenium/webdriver/driver_spec.rb
This also allows running from within Rubymine (importantly including using the debugger).

@p0deje - I changed spec_support.rb to require_relative instead of autoload for RackServer. I didn't dig into why RackServer needs to be lazy loaded; I'm guessing it's because we don't need it if we're just running unit tests. That doesn't seem to be much overhead, but if the "right answer" to this is easy and better, let me know, otherwise let's merge this.

(also, I ran ./go test_rb on my mac with this code and everything passed).

@p0deje
Copy link
Member

p0deje commented Sep 16, 2015

If it works, why not?

My only question is - does it work when spec is run outside rb directory? For example:

$ cd rb/spec/integration/
$ bundle exec rspec selenium/webdriver/app_cache_spec.rb

@titusfortner
Copy link
Member Author

Yes, that works as well. Thanks, I'll merge.

titusfortner added a commit that referenced this pull request Sep 16, 2015
rb - update file loading to allow tests to be run from relative directories
@titusfortner titusfortner merged commit 738fadf into SeleniumHQ:master Sep 16, 2015
@p0deje
Copy link
Member

p0deje commented Sep 16, 2015

@titusfortner Ouch, ain't we rebase and push instead of merging PRs?

@titusfortner
Copy link
Member Author

I wanted a merged PR to link to. :) I thought if I didn't use the github UI that I would then have to manually close the PR and I thought that would be confusing.

@p0deje
Copy link
Member

p0deje commented Sep 17, 2015

@titusfortner If you just rebase and push to master, PR will be shown as merged too.

@titusfortner
Copy link
Member Author

Yeah, @lukeis educated me on this on IRC earlier. :)

@titusfortner titusfortner deleted the rb_relative_paths branch February 27, 2016 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants