Code Monkey home page Code Monkey logo

midje-nrepl's Introduction

midje-nrepl

License Clojars Project Build status

nREPL middleware to interact with Midje

The goal of midje-nrepl is to provide a better support for interacting with Midje from Clojure tools such as Cider. It offers a set of features for running Midje tests, getting report information and formatting facilities to be used within a nREPL session.

Usage

With Cider and Emidje

If you are using Cider and Emidje within Emacs, just call cider-jack-in and the appropriate midje-nrepl's version will be injected in the REPL automatically.

If you are connecting to an already running REPL process, midje-nrepl should be added explicitly. Add the following, either in your project's project.clj, or in the :user profile found at ~/.lein/profiles.clj:

:plugins [[cider/cider-nrepl "0.18.0"]
[nubank/midje-nrepl "1.0.0"]]

Notice that currently only Leiningen is supported.

Available features

  • Inhibit Midje facts from being run on certain nREPL operations such as eval, load-file, refresh, refresh-all and warm-ast-cache (when refactor-nrepl) is available on the project's classpath. This is useful specially on large projects with slow and heavy tests, where those run inadvertently as a side effect of the aforementioned operations.
  • Provide a set of operations for dealing with Midje tests: to run a given fact, a set of facts in a given namespace, all facts defined in the project, allow re-running non-passing tests, etc.
  • Provide information about project's test paths and test namespaces declared within those paths.
  • Support auto-formatting tabular facts.

Changelog

An extensive changelog is available here.

Testing

Type make test to run unit tests (those under the test directory). Type make test-integration to run integration tests (those under the integration directory). They are useful for exercising a real communication with a nREPL server running within a fake project. If you are working interactively on a REPL and want to run integration tests, type make setup-integration to set-up the needed stuff. Type make test-all to run both kinds of tests.

License

Copyright © 2018 Nubank

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

midje-nrepl's People

Contributors

alan-ghelardi avatar francolamping avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

clojure-land

midje-nrepl's Issues

Weird exception when a string starts with a `/`

When a fact checks a string that starts with a /, an exception is thrown

Full repro:

Clojure 1.10.1
midje-nrepl 1.2.0-snapshot

/usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.7.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.1\"\] -- update-in :plugins conj \[nubank/midje-nrepl\ \"1.2.0-snapshot\"\] -- repl 

nREPL server started on port 63847 on host 127.0.0.1 - nrepl://127.0.0.1:63847
REPL-y 0.4.4, nREPL 0.7.0
Clojure 1.10.1
Java HotSpot(TM) 64-Bit Server VM 1.8.0_121-b13
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e


user=> (use 'midje.repl)
nil
user=> (fact (identity "/gql") => "/gql" )

Syntax error macroexpanding clojure.core/defn at (target/b85b0c8b9ab53121a9a5c5886ffbb788ae0678fc-init.clj:1:1).
(identity "/gql")17819 - failed: simple-symbol? at: [:fn-name] spec: :clojure.core.specs.alpha/defn-args

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.