From a0502c6e1c2378768a5e482f371b85ac32da3fb7 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Wed, 4 Jun 2014 20:51:25 +0300 Subject: [PATCH] fixed, all tests green --- Gemfile | 1 + Gemfile.lock | 62 +++++++++++++++++++ lib/parser/README.markdown => README.markdown | 0 README.rdoc | 19 ------ lib/parser.rb | 3 + test/{parse_helper.rb => parser_helper.rb} | 2 +- test/{helper.rb => setup.rb} | 4 +- test/test_arguments.rb | 2 +- test/test_basic.rb | 2 +- test/test_call_site.rb | 2 +- test/test_class.rb | 2 +- test/test_compound.rb | 2 +- test/test_conditional.rb | 2 +- test/test_expressions.rb | 2 +- test/test_fails.rb | 2 +- test/test_function_definition.rb | 2 +- test/test_module.rb | 2 +- test/test_operators.rb | 2 +- test/test_return.rb | 2 +- test/test_root.rb | 2 +- test/test_while.rb | 2 +- 21 files changed, 83 insertions(+), 36 deletions(-) create mode 100644 Gemfile.lock rename lib/parser/README.markdown => README.markdown (100%) delete mode 100644 README.rdoc rename test/{parse_helper.rb => parser_helper.rb} (98%) rename test/{helper.rb => setup.rb} (93%) diff --git a/Gemfile b/Gemfile index 9683c4f..8df6a84 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,7 @@ gem "parslet" # Add dependencies to develop your gem here. # Include everything needed to run rake, tests, features, etc. group :development do + gem "minitest" gem "rdoc", "~> 3.12" gem "bundler", "~> 1.0" gem "jeweler", "~> 2.0.1" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..bbec599 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,62 @@ +GEM + remote: http://rubygems.org/ + specs: + addressable (2.3.6) + blankslate (2.1.2.4) + builder (3.2.2) + descendants_tracker (0.0.4) + thread_safe (~> 0.3, >= 0.3.1) + faraday (0.9.0) + multipart-post (>= 1.2, < 3) + git (1.2.6) + github_api (0.11.3) + addressable (~> 2.3) + descendants_tracker (~> 0.0.1) + faraday (~> 0.8, < 0.10) + hashie (>= 1.2) + multi_json (>= 1.7.5, < 2.0) + nokogiri (~> 1.6.0) + oauth2 + hashie (2.1.1) + highline (1.6.21) + jeweler (2.0.1) + builder + bundler (>= 1.0) + git (>= 1.2.5) + github_api + highline (>= 1.6.15) + nokogiri (>= 1.5.10) + rake + rdoc + json (1.8.1) + jwt (1.0.0) + mini_portile (0.6.0) + minitest (5.3.2) + multi_json (1.9.2) + multi_xml (0.5.5) + multipart-post (2.0.0) + nokogiri (1.6.2.1) + mini_portile (= 0.6.0) + oauth2 (0.9.4) + faraday (>= 0.8, < 0.10) + jwt (~> 1.0) + multi_json (~> 1.3) + multi_xml (~> 0.5) + rack (~> 1.2) + parslet (1.6.1) + blankslate (~> 2.0) + rack (1.5.2) + rake (10.3.2) + rdoc (3.12.2) + json (~> 1.4) + thread_safe (0.3.4) + +PLATFORMS + ruby + +DEPENDENCIES + bundler (~> 1.0) + jeweler (~> 2.0.1) + minitest + parslet + rdoc (~> 3.12) diff --git a/lib/parser/README.markdown b/README.markdown similarity index 100% rename from lib/parser/README.markdown rename to README.markdown diff --git a/README.rdoc b/README.rdoc deleted file mode 100644 index 24ec77a..0000000 --- a/README.rdoc +++ /dev/null @@ -1,19 +0,0 @@ -= crystal-reader - -Description goes here. - -== Contributing to crystal-reader - -* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet. -* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it. -* Fork the project. -* Start a feature/bugfix branch. -* Commit and push until you are happy with your contribution. -* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally. -* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it. - -== Copyright - -Copyright (c) 2014 Torsten Ruger. See LICENSE.txt for -further details. - diff --git a/lib/parser.rb b/lib/parser.rb index e69de29..1b47efd 100644 --- a/lib/parser.rb +++ b/lib/parser.rb @@ -0,0 +1,3 @@ +require 'parslet' +require 'parser/crystal' +require 'parser/transform' diff --git a/test/parse_helper.rb b/test/parser_helper.rb similarity index 98% rename from test/parse_helper.rb rename to test/parser_helper.rb index 5f058dc..9b5f945 100644 --- a/test/parse_helper.rb +++ b/test/parser_helper.rb @@ -1,4 +1,4 @@ -require_relative "../helper" +require_relative "setup" require "parslet/convenience" # remove the line numbers on assert fails, so it's easy to copy paste the result as the expected result diff --git a/test/helper.rb b/test/setup.rb similarity index 93% rename from test/helper.rb rename to test/setup.rb index 7fb0e8e..fccce23 100644 --- a/test/helper.rb +++ b/test/setup.rb @@ -9,13 +9,13 @@ rescue Bundler::BundlerError => e $stderr.puts "Run `bundle install` to install missing gems" exit e.status_code end -require 'test/unit' -require 'shoulda' $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) + require 'parser' +require "minitest" require "minitest/autorun" $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) diff --git a/test/test_arguments.rb b/test/test_arguments.rb index b11eb97..60c6844 100644 --- a/test/test_arguments.rb +++ b/test/test_arguments.rb @@ -1,4 +1,4 @@ -require_relative "helper" +require_relative "parser_helper" class TestArguments < MiniTest::Test # include the magic (setup and parse -> test method translation), see there diff --git a/test/test_basic.rb b/test/test_basic.rb index 4caa107..d7aa663 100644 --- a/test/test_basic.rb +++ b/test/test_basic.rb @@ -1,4 +1,4 @@ -require_relative "helper" +require_relative "parser_helper" class TestBasic < MiniTest::Test # include the magic (setup and parse -> test method translation), see there diff --git a/test/test_call_site.rb b/test/test_call_site.rb index 12619a4..2572deb 100644 --- a/test/test_call_site.rb +++ b/test/test_call_site.rb @@ -1,4 +1,4 @@ -require_relative "helper" +require_relative "parser_helper" class TestCallSite < MiniTest::Test # include the magic (setup and parse -> test method translation), see there diff --git a/test/test_class.rb b/test/test_class.rb index 183a5f3..71b065d 100644 --- a/test/test_class.rb +++ b/test/test_class.rb @@ -1,4 +1,4 @@ -require_relative "helper" +require_relative "parser_helper" class TestClassDef < MiniTest::Test # include the magic (setup and parse -> test method translation), see there diff --git a/test/test_compound.rb b/test/test_compound.rb index 03121e7..fa048ca 100644 --- a/test/test_compound.rb +++ b/test/test_compound.rb @@ -1,4 +1,4 @@ -require_relative "helper" +require_relative "parser_helper" class TestCompound < MiniTest::Test # include the magic (setup and parse -> test method translation), see there diff --git a/test/test_conditional.rb b/test/test_conditional.rb index 4882e6c..bc083ac 100644 --- a/test/test_conditional.rb +++ b/test/test_conditional.rb @@ -1,4 +1,4 @@ -require_relative "helper" +require_relative "parser_helper" class TestConditional < MiniTest::Test # include the magic (setup and parse -> test method translation), see there diff --git a/test/test_expressions.rb b/test/test_expressions.rb index 0eee563..cd79618 100644 --- a/test/test_expressions.rb +++ b/test/test_expressions.rb @@ -1,4 +1,4 @@ -require_relative "helper" +require_relative "parser_helper" class TestExpressions < MiniTest::Test # include the magic (setup and parse -> test method translation), see there diff --git a/test/test_fails.rb b/test/test_fails.rb index 76cf65a..6adbc01 100644 --- a/test/test_fails.rb +++ b/test/test_fails.rb @@ -1,4 +1,4 @@ -require_relative "helper" +require_relative "parser_helper" # some cases that fail, and fail badly. diff --git a/test/test_function_definition.rb b/test/test_function_definition.rb index 21a6de9..e76b55c 100644 --- a/test/test_function_definition.rb +++ b/test/test_function_definition.rb @@ -1,4 +1,4 @@ -require_relative "helper" +require_relative "parser_helper" class TestFunctionDefinition < MiniTest::Test # include the magic (setup and parse -> test method translation), see there diff --git a/test/test_module.rb b/test/test_module.rb index 9089d0a..02bd90d 100644 --- a/test/test_module.rb +++ b/test/test_module.rb @@ -1,4 +1,4 @@ -require_relative "helper" +require_relative "parser_helper" class TestModuleDef < MiniTest::Test # include the magic (setup and parse -> test method translation), see there diff --git a/test/test_operators.rb b/test/test_operators.rb index 6d3c7d7..9b163fa 100644 --- a/test/test_operators.rb +++ b/test/test_operators.rb @@ -1,4 +1,4 @@ -require_relative "helper" +require_relative "parser_helper" class TestExpressions < MiniTest::Test # include the magic (setup and parse -> test method translation), see there diff --git a/test/test_return.rb b/test/test_return.rb index 18819c2..6bdef96 100644 --- a/test/test_return.rb +++ b/test/test_return.rb @@ -1,4 +1,4 @@ -require_relative "helper" +require_relative "parser_helper" class TestReturn < MiniTest::Test # include the magic (setup and parse -> test method translation), see there diff --git a/test/test_root.rb b/test/test_root.rb index fb0db1d..542fd1a 100644 --- a/test/test_root.rb +++ b/test/test_root.rb @@ -1,4 +1,4 @@ -require_relative "helper" +require_relative "parser_helper" class TestRoot < MiniTest::Test # include the magic (setup and parse -> test method translation), see there diff --git a/test/test_while.rb b/test/test_while.rb index c72e280..b159778 100644 --- a/test/test_while.rb +++ b/test/test_while.rb @@ -1,4 +1,4 @@ -require_relative "helper" +require_relative "parser_helper" class TestWhile < MiniTest::Test # include the magic (setup and parse -> test method translation), see there