initial commit

This commit is contained in:
2023-07-01 07:23:51 +01:00
commit 984322d789
29 changed files with 1772 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
require 'spec_helper'
require 'selenium-webdriver'
describe 'index.html' do
before do
Encoding.default_external='utf-8'
@webserver=start_http()
@webdriver = Selenium::WebDriver.for :firefox
end
it "Http get should be successfull." do
@webdriver.navigate.to "http://127.0.0.1:10080/index.html"
expect(@webdriver.title).to eq "rbenv for Windows test page"
end
after do
@webdriver.quit
@webserver.shutdown
end
end

View File

@@ -0,0 +1,25 @@
# $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'bundler/setup'
require 'webrick'
def start_http(opt={})
s = WEBrick::HTTPServer.new({
:DocumentRoot => File.expand_path('../../html', __FILE__),
:BindAddress => '127.0.0.1',
:Port => 10080,
:AccessLog => [[File.open('accesslog.txt', 'w'), WEBrick::AccessLog::CLF]],
:Logger => WEBrick::Log.new("log.txt", WEBrick::BasicLog::DEBUG),
}.merge(opt).merge({:StartCallback => Proc.new{ Thread.main.wakeup }}))
trap("INT"){ s.shutdown }
@server_thread = Thread.new do
s.start
end
Thread.stop
s
end
RSpec.configure do |config|
config.filter_run :debug => true
config.run_all_when_everything_filtered = true
end