From f425019347d67fc44065dfb0e98121c3a5561875 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Sun, 3 Jan 2021 06:14:01 +0100 Subject: [PATCH] Add basic specs --- Makefile | 5 ++++- spec/cli_spec.cr | 12 ++++++++++++ spec/spec_helper.rb | 9 --------- spec/tui_spec.cr | 11 +++++++++++ 4 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 spec/cli_spec.cr delete mode 100644 spec/spec_helper.rb create mode 100644 spec/tui_spec.cr diff --git a/Makefile b/Makefile index dc5e687..b967cd6 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,13 @@ BUILD_DIR=_build all: help -build: # ## build binary +build: ## build binary mkdir -p $(BUILD_DIR) crystal build -o $(BUILD_DIR)/$(PROGNAME) src/main.cr +test: ## test binary + crystal spec + help: ## print this help @echo "Usage: make " @echo "" diff --git a/spec/cli_spec.cr b/spec/cli_spec.cr new file mode 100644 index 0000000..2ef0bbd --- /dev/null +++ b/spec/cli_spec.cr @@ -0,0 +1,12 @@ + +require "spec" +require "../src/lib/cli" + +describe Noozoid::Cli do + describe "#start" do + it "cshould respond to this method on class" do + {{ Noozoid::Cli.class.has_method?("start") }}.should be_true + end + end +end + diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb deleted file mode 100644 index cb6a3fd..0000000 --- a/spec/spec_helper.rb +++ /dev/null @@ -1,9 +0,0 @@ -$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__) -require "namarara" - -require "minitest/autorun" -require 'pathname' - -def testfile(name) - Pathname.new(__FILE__).dirname.join('files', name) -end diff --git a/spec/tui_spec.cr b/spec/tui_spec.cr new file mode 100644 index 0000000..12f24de --- /dev/null +++ b/spec/tui_spec.cr @@ -0,0 +1,11 @@ + +require "spec" +require "../src/lib/tui" + +describe Noozoid::Tui do + describe "#run" do + it "cshould respond to this method on class" do + {{ Noozoid::Tui.has_method?("run") }}.should be_true + end + end +end