jasmine / jasmine-gem

Jasmine ruby gem
682 stars 274 forks source link

Add Host Support with Specs #243

Closed dariusgm closed 9 years ago

dariusgm commented 9 years ago

As I want to use the Jasmine Runner inside a VM. I want to be able to pass the Host to the Server call and make it available from my host Server.

The specs are locally not running without the changes, this pull request should just give you an idea of how it is supposed to work.

ruby 2.1.5p273 on Windows 7, 64-bit

slackersoft commented 9 years ago

I think the spec you're looking to write for this is something more like:

it "should create a Rack::Server with the correct host when passed" do
  host = "1.2.3.4"
  Rack::Server.should_receive(:new).with(hash_including(:Host => host)).and_return(double(:server).as_null_object)
  Jasmine::Server.new(1234, double(:app), :Host => host).start
end

When I run that spec now, it is already green, so I'm not sure the implementation you have is actually required to make this feature work.