Giter VIP home page Giter VIP logo

bdd's People

Contributors

adamkrellenstein avatar ddspog avatar eduncan911 avatar shawnps avatar

Watchers

 avatar  avatar

bdd's Issues

With Sentence

Is your feature request related to a problem? Please describe.

Sometimes writing descriptions on Given, When and It sentences feels too much. I'm trying to improve documentation on a test, but the Given text ends up too large for it.

For example, when testing with hashes in passwords, I would like to write:

Given a password mynameissecret and hash asldjaskdjlakmdwldmqwd2311sdandlj

Depending on the hash size, the test wouldn't be able to print it in one line, and it would become ugly afterwards. There should be a nice way to print more information in more lines.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered

I would like to have a With sentence available inside any given. With that any time i would use with function, it would print more information right below the current sentence, with detailed information.

The printed version would start with "with" word, but if there are more calls after the first with for any sentence, it would print it right below the first one, with the adequate tab, and starting with "and" word.

The code should be like this:

func Test_Sentences(t *testing.T) {
	given := bdd.Sentences().Given()

	given(t, "a pass password mynameissecret and otherPass password mynameisnotjonnhy", func(when bdd.When, with bdd.With) {
		with("a oldHash hash asdalkdmwl31d3d2d and oldOtherHash hash qiwdno312dasd12")
		with("current time being 2:00 AM from 29/05/2018")

		...
	
		when("Compare(pass, oldHash) is called")
	})
}

This would print something like this:

Feature Sentences
	Given a pass password mynameissecret and otherPass password mynameisnotjonnhy
	with a oldHash hash asdalkdmwl31d3d2d and oldOtherHash hash qiwdno312dasd12
	and current time being 2:00 AM from 29/05/2018
		When Compare(pass, oldHash) is called

Better Panics

Is your feature request related to a problem? Please describe.

When something related to configuration fails, the program panic. The problem is that sometimes, it isn't very informative. There are also errors that are thrown unexpectedly.

For example, when the given message doesn't match one key on golden file, an index error is thrown and programs panic. There should be something more informative about this.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered

I would like the configuration errors with the bdd package, have lots of information detailing error if possible. It would be something similar to how bdd package explains errors on asserts.

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.