first mini test, remove spec

This commit is contained in:
Torsten Ruger 2015-07-24 18:38:37 +03:00
parent 1526656dfe
commit 93ac945dd2
9 changed files with 47 additions and 40 deletions

View File

@ -9,3 +9,8 @@ gem "salama" , path: "../salama"
gem "salama-reader" , path: "../salama-reader"
gem "salama-arm" , path: "../salama-arm"
gem "salama-object-file" , path: "../salama-object-file"
group :development do
gem "minitest"
gem "rubygems-tasks"
end

View File

@ -37,6 +37,7 @@ GEM
remote: https://rubygems.org/
specs:
hike (1.2.3)
minitest (5.7.0)
opal (0.8.0)
hike (~> 1.2)
sourcemap (~> 0.1.0)
@ -48,6 +49,7 @@ GEM
opal (>= 0.7.0, < 0.9.0)
rack (1.6.4)
react-source (0.13.3)
rubygems-tasks (0.2.4)
sourcemap (0.1.1)
sprockets (3.2.0)
rack (~> 1.0)
@ -57,10 +59,12 @@ PLATFORMS
ruby
DEPENDENCIES
minitest
opal-jquery
opal-react!
parslet!
react-source
rubygems-tasks
salama!
salama-arm!
salama-object-file!

View File

@ -1,5 +0,0 @@
require 'spec_helper'
describe 'sample http controller test', type: :http_controller do
# Specs here
end

View File

@ -1,11 +0,0 @@
require 'spec_helper'
describe 'sample integration test', type: :feature do
# An example integration spec, this will only be run if ENV['BROWSER'] is
# specified. Current values for ENV['BROWSER'] are 'firefox' and 'phantom'
it 'should load the page' do
visit '/'
expect(page).to have_content('Home')
end
end

View File

@ -1,5 +0,0 @@
require 'spec_helper'
describe 'sample model' do
# Specs here
end

View File

@ -1,5 +0,0 @@
require 'spec_helper'
describe 'sample task', type: :task do
# Specs here
end

View File

@ -1,14 +0,0 @@
# Volt sets up rspec and capybara for testing.
require 'volt/spec/setup'
Volt.spec_setup
RSpec.configure do |config|
config.run_all_when_everything_filtered = true
config.filter_run :focus
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = 'random'
end

21
test/helper.rb Normal file
View File

@ -0,0 +1,21 @@
require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
if ENV['CODECLIMATE_REPO_TOKEN']
require "codeclimate-test-reporter"
CodeClimate::TestReporter.start
end
require "minitest/autorun"
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'test'))
require "salama"
require "interpreter"

17
test/interpreter_test.rb Normal file
View File

@ -0,0 +1,17 @@
require_relative "helper"
class InterpreterTest < MiniTest::Test
def setup
Virtual.machine.boot
code = Ast::ExpressionList.new( [Ast::CallSiteExpression.new(:putstring, [] ,Ast::StringExpression.new("Hello again"))])
Virtual::Compiler.compile( code , Virtual.machine.space.get_main )
Virtual.machine.run_before "Register::CallImplementation"
@interpreter = Interpreter.new
@interpreter.start Virtual.machine.init
end
def test_first
@interpreter.tick
end
end