Shard Detail

da_spec v1.1.2

My personal spec (ie testing) library because I work alone and I can do stupid stuff like this.

Install & Use

Add the following code to your project's shard.yml under:

dependencies to use in production
- OR -
development_dependencies to use in development


da_spec:
  github: da99/da_spec

Readme

da_spec.cr

My personal testing library for use in Crystal. No one would want to use this except myself.

Reference


  require "da_spec"

  DA_Spec.pattern "name of test"
  DA_Spec.pattern /name of test/

  extend DA_SPEC

  describe "My_Class" do

    it "does something" do
      assert My_Class.name == "My_Class"
    end

    it "fails" do
      assert_raises(IndexError) {
        a = [] of Int32
        a.pop
      } # returns the error.
    end

  end # === describe

  module DA_SPEC
    def examine(*pairs)
      # override this method to display the actual/expected
      # results when an assertion fails.
    end
  end # module