jasmine 0.10.3 → 0.10.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ module Jasmine
17
17
 
18
18
  def start
19
19
  start_servers
20
- @client = Jasmine::SeleniumDriver.new("localhost", @selenium_server_port, "*#{@browser}", "http://localhost:#{@jasmine_server_port}/")
20
+ @client = Jasmine::SeleniumDriver.new("localhost", @selenium_server_port, "*#{@browser}", "#{jasmine_host}:#{@jasmine_server_port}/")
21
21
  @client.connect
22
22
  end
23
23
 
@@ -26,6 +26,10 @@ module Jasmine
26
26
  stop_servers
27
27
  end
28
28
 
29
+ def jasmine_host
30
+ ENV["JASMINE_HOST"] || 'http://localhost'
31
+ end
32
+
29
33
  def start_jasmine_server
30
34
  @jasmine_server_port = Jasmine::find_unused_port
31
35
  server = Jasmine::Server.new(@jasmine_server_port, self)
@@ -46,9 +46,9 @@ describe Jasmine::Config do
46
46
  @config.spec_files.should == ['ExampleSpec.js']
47
47
  @config.helpers.should == ['helpers/SpecHelper.js']
48
48
  @config.js_files.should == [
49
- '/__spec__/helpers/SpecHelper.js',
50
- '/__spec__/ExampleSpec.js',
51
- ]
49
+ '/__spec__/helpers/SpecHelper.js',
50
+ '/__spec__/ExampleSpec.js',
51
+ ]
52
52
  @config.js_files("ExampleSpec.js").should ==
53
53
  ['/__spec__/helpers/SpecHelper.js',
54
54
  '/__spec__/ExampleSpec.js']
@@ -141,9 +141,9 @@ describe Jasmine::Config do
141
141
 
142
142
  end
143
143
 
144
- describe "browsers" do
144
+ describe "browser configuration" do
145
145
  it "should use firefox by default" do
146
- ENV.should_receive(:[], "JASMINE_BROWSER").and_return(nil)
146
+ ENV.stub!(:[], "JASMINE_BROWSER").and_return(nil)
147
147
  config = Jasmine::Config.new
148
148
  config.stub!(:start_servers)
149
149
  Jasmine::SeleniumDriver.should_receive(:new).
@@ -153,7 +153,7 @@ describe Jasmine::Config do
153
153
  end
154
154
 
155
155
  it "should use ENV['JASMINE_BROWSER'] if set" do
156
- ENV.should_receive(:[], "JASMINE_BROWSER").and_return("mosaic")
156
+ ENV.stub!(:[], "JASMINE_BROWSER").and_return("mosaic")
157
157
  config = Jasmine::Config.new
158
158
  config.stub!(:start_servers)
159
159
  Jasmine::SeleniumDriver.should_receive(:new).
@@ -161,6 +161,31 @@ describe Jasmine::Config do
161
161
  and_return(mock(Jasmine::SeleniumDriver, :connect => true))
162
162
  config.start
163
163
  end
164
+ end
165
+
166
+ describe "jasmine host" do
167
+ it "should use http://localhost by default" do
168
+ config = Jasmine::Config.new
169
+ config.instance_variable_set(:@jasmine_server_port, '1234')
170
+ config.stub!(:start_servers)
171
+
172
+ Jasmine::SeleniumDriver.should_receive(:new).
173
+ with(anything(), anything(), anything(), "http://localhost:1234/").
174
+ and_return(mock(Jasmine::SeleniumDriver, :connect => true))
175
+ config.start
176
+ end
177
+
178
+ it "should use ENV['JASMINE_HOST'] if set" do
179
+ ENV.stub!(:[], "JASMINE_HOST").and_return("http://some_host")
180
+ config = Jasmine::Config.new
181
+ config.instance_variable_set(:@jasmine_server_port, '1234')
182
+ config.stub!(:start_servers)
183
+
184
+ Jasmine::SeleniumDriver.should_receive(:new).
185
+ with(anything(), anything(), anything(), "http://some_host:1234/").
186
+ and_return(mock(Jasmine::SeleniumDriver, :connect => true))
187
+ config.start
188
+ end
164
189
  end
165
190
 
166
191
  describe "#start_selenium_server" do
@@ -172,4 +197,5 @@ describe Jasmine::Config do
172
197
  end
173
198
  end
174
199
 
200
+
175
201
  end
metadata CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 10
8
8
  - 3
9
- version: 0.10.3
9
+ - 1
10
+ version: 0.10.3.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Rajan Agaskar
@@ -15,7 +16,7 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2010-04-01 00:00:00 -07:00
19
+ date: 2010-04-02 00:00:00 -07:00
19
20
  default_executable: jasmine
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency