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,8 @@
source 'https://rubygems.org'
# Specify your gem's dependencies in ariblib.gemspec
group :development, :test do
gem 'rake'
gem 'rspec'
gem 'selenium-webdriver'
end

View File

@@ -0,0 +1,10 @@
#require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
task :init do
sh "bundle install --path vendor/bundle"
end

View File

@@ -0,0 +1,11 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>rbenv for Windows test page</title>
</head>
<body>
<h1>rbenv for Windows</h1>
</body>
</html>

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

7
test/rake.bat Normal file
View File

@@ -0,0 +1,7 @@
@echo off
call bundle show > NUL
if ERRORLEVEL 1 (
rbenv exec %~n0 %*
) else (
bundle exec %~n0 %*
)

120
test/test.bat Normal file
View File

@@ -0,0 +1,120 @@
@echo off
setlocal
set PATH=%~dp0..\bin;%~dp0..\shims;%PATH%
echo :install: test
call rbenv install -l
call rbenv install 2.1.8
call rbenv install 2.1.7-x64
call rbenv install 1.9.3-p551
mkdir test
cd test
echo :global: test
call rbenv global 2.1.8
call rbenv rehash
call ruby -v
call rbenv version
call rbenv versions
echo :local: test
call rbenv local 2.1.7-x64
call rbenv rehash
call ruby -v
call rbenv version
call rbenv versions
cd ..
call ruby -v
call rbenv version
call rbenv versions
cd test
call ruby -v
call rbenv version
call rbenv versions
echo :shell: test
call rbenv shell 1.9.3-p551
call rbenv rehash
call ruby -v
call rbenv version
call rbenv versions
cd ..
call ruby -v
call rbenv version
call rbenv versions
cd test
call ruby -v
call rbenv version
call rbenv versions
echo :shell --unset: test
call rbenv shell --unset
call rbenv rehash
call ruby -v
call rbenv version
call rbenv versions
echo :local --unset: test
call rbenv local --unset
call rbenv rehash
call ruby -v
call rbenv version
call rbenv versions
cd ..
rmdir /s /q test
echo :rehash: test
call rbenv shell 2.1.8
call rbenv rehash
call gem install bundler
call where bundle
call rbenv rehash
call where bundle
echo :DevKit i386: test
call xcopy "%~dp0\gem_rake_bundler" "%~dp0test\" /E /H /R /K /Y /I /F
cd test
call rbenv shell 2.1.8
call rbenv rehash
call gem install bundler
call rbenv rehash
call bundle install --path vendor/bundle
call bundle platform
call bundle exec rake
cd ..
rmdir /s /q test
echo :DevKit x64: test
call xcopy "%~dp0\gem_rake_bundler" "%~dp0test\" /E /H /R /K /Y /I /F
cd test
call rbenv shell 2.1.7-x64
call rbenv rehash
call gem install bundler
call rbenv rehash
call bundle install --path vendor/bundle
call bundle platform
call bundle exec rake
cd ..
rmdir /s /q test
echo :DevKit tdm: test
call xcopy "%~dp0\gem_rake_bundler" "%~dp0test\" /E /H /R /K /Y /I /F
cd test
call rbenv shell 1.9.3-p551
call rbenv rehash
call gem install rubygems-update
call rbenv rehash
call update_rubygems
call rbenv rehash
call gem install bundler
call rbenv rehash
call bundle install --path vendor/bundle
call bundle platform
call bundle exec rake
cd ..
rmdir /s /q test