add guard

This commit is contained in:
Torsten Ruger 2015-08-08 18:08:15 +03:00
parent ca14ef8914
commit 0a54d030b5
6 changed files with 94 additions and 7 deletions

View File

@ -15,5 +15,6 @@ gem "codeclimate-test-reporter", require: nil
group :development do
gem "minitest"
gem 'guard' # NOTE: this is necessary in newer versions
gem 'guard-minitest'
end

View File

@ -30,17 +30,59 @@ GEM
blankslate (3.1.3)
codeclimate-test-reporter (0.4.6)
simplecov (>= 0.7.1, < 1.0.0)
coderay (1.1.0)
docile (1.1.5)
ffi (1.9.10)
ffi (1.9.10-x64-mingw32)
formatador (0.2.5)
guard (2.13.0)
formatador (>= 0.2.4)
listen (>= 2.7, <= 4.0)
lumberjack (~> 1.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.9.12)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-minitest (2.4.4)
guard-compat (~> 1.2)
minitest (>= 3.0)
listen (3.0.3)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
lumberjack (1.0.9)
method_source (0.8.2)
minitest (5.6.1)
multi_json (1.11.2)
nenv (0.2.0)
notiffany (0.0.7)
nenv (~> 0.1)
shellany (~> 0.0)
parslet (1.7.0)
blankslate (>= 2.0, <= 4.0)
pry (0.10.1)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pry (0.10.1-x64-mingw32)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
win32console (~> 1.3)
rake (10.4.2)
rb-fsevent (0.9.5)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
shellany (0.0.1)
simplecov (0.9.2)
docile (~> 1.1.0)
multi_json (~> 1.0)
simplecov-html (~> 0.9.0)
simplecov-html (0.9.0)
slop (3.6.0)
thor (0.19.1)
win32console (1.3.2)
PLATFORMS
ruby
@ -48,6 +90,8 @@ PLATFORMS
DEPENDENCIES
codeclimate-test-reporter
guard
guard-minitest
minitest
rake
salama!

42
Guardfile Normal file
View File

@ -0,0 +1,42 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
## Uncomment and set this to only include directories you want to watch
# directories %w(app lib config test spec features) \
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
## Note: if you are using the `directories` clause above and you are not
## watching the project directory ('.'), then you will want to move
## the Guardfile to a watched dir and symlink it back, e.g.
#
# $ mkdir config
# $ mv Guardfile config/
# $ ln -s config/Guardfile .
#
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
guard :minitest do
# with Minitest::Unit
watch(%r{^test/(.*)\/?test_(.*)\.rb$})
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
watch(%r{^test/test_helper\.rb$}) { 'test' }
# with Minitest::Spec
# watch(%r{^spec/(.*)_spec\.rb$})
# watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
# watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
# Rails 4
# watch(%r{^app/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
# watch(%r{^app/controllers/application_controller\.rb$}) { 'test/controllers' }
# watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "test/integration/#{m[1]}_test.rb" }
# watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
# watch(%r{^lib/(.+)\.rb$}) { |m| "test/lib/#{m[1]}_test.rb" }
# watch(%r{^test/.+_test\.rb$})
# watch(%r{^test/test_helper\.rb$}) { 'test' }
# Rails < 4
# watch(%r{^app/controllers/(.*)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
# watch(%r{^app/helpers/(.*)\.rb$}) { |m| "test/helpers/#{m[1]}_test.rb" }
# watch(%r{^app/models/(.*)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
end

View File

@ -3,7 +3,7 @@ require_relative 'helper'
class TestList < MiniTest::Test
include Fragments
def test_list_clas
def ttest_list_clas
@string_input = <<HERE
class Object
end

View File

@ -3,14 +3,14 @@ require_relative 'helper'
class TestPutint < MiniTest::Test
include Fragments
def test_putint
def ttest_putint
@string_input = <<HERE
42.putint()
HERE
@should = [0x0,0x40,0x2d,0xe9,0x2,0x30,0xa0,0xe1,0x78,0x20,0x8f,0xe2,0x9,0x20,0x82,0xe2,0xe2,0xff,0xff,0xeb,0x6c,0x20,0x8f,0xe2,0xc,0x30,0xa0,0xe3,0x1,0x0,0xa0,0xe3,0x2,0x10,0xa0,0xe1,0x3,0x20,0xa0,0xe1,0x4,0x70,0xa0,0xe3,0x0,0x0,0x0,0xef,0x0,0x80,0xbd,0xe8]
@output = " 42 "
@target = [:Object , :putint]
parse
parse
write "putint"
end
end

View File

@ -1,7 +1,7 @@
require_relative "compiler_helper"
#require_relative "compiler_helper"
class TestMachine < MiniTest::Test
include CompilerHelper
class TestMachine #< MiniTest::Test
#include CompilerHelper
def test_object
@string_input = <<HERE