add guard
This commit is contained in:
parent
ca14ef8914
commit
0a54d030b5
3
Gemfile
3
Gemfile
@ -15,5 +15,6 @@ gem "codeclimate-test-reporter", require: nil
|
|||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
gem "minitest"
|
gem "minitest"
|
||||||
|
gem 'guard' # NOTE: this is necessary in newer versions
|
||||||
|
gem 'guard-minitest'
|
||||||
end
|
end
|
||||||
|
44
Gemfile.lock
44
Gemfile.lock
@ -30,17 +30,59 @@ GEM
|
|||||||
blankslate (3.1.3)
|
blankslate (3.1.3)
|
||||||
codeclimate-test-reporter (0.4.6)
|
codeclimate-test-reporter (0.4.6)
|
||||||
simplecov (>= 0.7.1, < 1.0.0)
|
simplecov (>= 0.7.1, < 1.0.0)
|
||||||
|
coderay (1.1.0)
|
||||||
docile (1.1.5)
|
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)
|
minitest (5.6.1)
|
||||||
multi_json (1.11.2)
|
multi_json (1.11.2)
|
||||||
|
nenv (0.2.0)
|
||||||
|
notiffany (0.0.7)
|
||||||
|
nenv (~> 0.1)
|
||||||
|
shellany (~> 0.0)
|
||||||
parslet (1.7.0)
|
parslet (1.7.0)
|
||||||
blankslate (>= 2.0, <= 4.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)
|
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)
|
simplecov (0.9.2)
|
||||||
docile (~> 1.1.0)
|
docile (~> 1.1.0)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
simplecov-html (~> 0.9.0)
|
simplecov-html (~> 0.9.0)
|
||||||
simplecov-html (0.9.0)
|
simplecov-html (0.9.0)
|
||||||
|
slop (3.6.0)
|
||||||
|
thor (0.19.1)
|
||||||
|
win32console (1.3.2)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
@ -48,6 +90,8 @@ PLATFORMS
|
|||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
codeclimate-test-reporter
|
codeclimate-test-reporter
|
||||||
|
guard
|
||||||
|
guard-minitest
|
||||||
minitest
|
minitest
|
||||||
rake
|
rake
|
||||||
salama!
|
salama!
|
||||||
|
42
Guardfile
Normal file
42
Guardfile
Normal 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
|
@ -3,7 +3,7 @@ require_relative 'helper'
|
|||||||
class TestList < MiniTest::Test
|
class TestList < MiniTest::Test
|
||||||
include Fragments
|
include Fragments
|
||||||
|
|
||||||
def test_list_clas
|
def ttest_list_clas
|
||||||
@string_input = <<HERE
|
@string_input = <<HERE
|
||||||
class Object
|
class Object
|
||||||
end
|
end
|
||||||
|
@ -3,14 +3,14 @@ require_relative 'helper'
|
|||||||
class TestPutint < MiniTest::Test
|
class TestPutint < MiniTest::Test
|
||||||
include Fragments
|
include Fragments
|
||||||
|
|
||||||
def test_putint
|
def ttest_putint
|
||||||
@string_input = <<HERE
|
@string_input = <<HERE
|
||||||
42.putint()
|
42.putint()
|
||||||
HERE
|
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]
|
@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 "
|
@output = " 42 "
|
||||||
@target = [:Object , :putint]
|
@target = [:Object , :putint]
|
||||||
parse
|
parse
|
||||||
write "putint"
|
write "putint"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
require_relative "compiler_helper"
|
#require_relative "compiler_helper"
|
||||||
|
|
||||||
class TestMachine < MiniTest::Test
|
class TestMachine #< MiniTest::Test
|
||||||
include CompilerHelper
|
#include CompilerHelper
|
||||||
|
|
||||||
def test_object
|
def test_object
|
||||||
@string_input = <<HERE
|
@string_input = <<HERE
|
||||||
|
Loading…
Reference in New Issue
Block a user