Code Monkey home page Code Monkey logo

assent's People

Contributors

304notmodified avatar adamchester avatar corey-underdown avatar droyad avatar dwat001-auror avatar hakmart1 avatar masaeedu avatar matt-richardson avatar mjrichardson avatar nbarbettini avatar richev-o avatar

Stargazers

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

Watchers

 avatar  avatar

assent's Issues

VsCode diff reporter not working.

In my test, I am using a reporter that has the vscode diff program in:
image

However the Assent throws an exception that it could not find a diff program to use:

System.Exception: 'Could not find a diff program to use'

Yet if I look at the searchpaths to Code.exe it is correct.

Not sure what I am doing wrong?

Here is the configuration code:

            // Now verify the xml looks good.
            var configuration = new Configuration().UsingExtension(".xml");
            var programs = new IDiffProgram[] {
                    new VsCodeDiffProgram()
                }
                .Concat(Assent.Reporters.DiffReporter.DefaultDiffPrograms)
                .ToArray();
            var reporter = new Assent.Reporters.DiffReporter(programs);
            configuration.UsingReporter(reporter);           

            // This throws.
            this.Assent(xmlStringBuilder.ToString(), configuration);

And I am running the test under netcoreapp2.0

Meld inserts EOL at EOF - which fails latter string comparison

When using MEld as a comparison tool - meld automatically inserts an EOL on the last line of text (as per POSIX standard).

When the assent test is re-run against the Meld generated file, the comparison fails, as the approval file contains an extra EOL which does/may not exist in generated string.

Found on Ubuntuy 22.04.

Creating a configuration throws on OSX

When you create a configuration it creates a DiffReporter

When you create a DiffReporter it creates instances of the default comparers and somewhere in there its throwing an error when run on OSX.

So the custom configuration is basically ignored...

I need to dig a bit further to properly understand what part of the constructor sequence is causing the error.

Capturing the file path when compiling makes it impossible to build under one folder and run under another

Using CallerFilePath (https://github.com/droyad/Assent/blob/master/src/Assent/Extensions.cs#L12) captures the file path during compilation.
I had a very weird problem that on my CI (teamcity) i was building the project in one build and passed the built output to another build that runs the tests, the filepath was wrong and my approved files were always empty.

Maybe the more conventional way is to use the working dir ?

WinMerge

I have winmerge installed, but it's not detected as a merge tool. Would you consider including support for it out of the box?

Add env var to allow accepting everything by default

I'm using this library to basically hold functionality in place in a large legacy app I'm refactoring. The current behavior of the application, for better or worse, is what I want to preserve.

To do this I'm generating and running thousands of approval-based tests that describe how data interacts with the application, which means it's pretty painful to manually go through and approve every diff using my diff tool. I need some kind of option to approve everything the first time I run it, possibly an env var.

Would this be a change you'd be open to having?

Add a built in Console reporter to support CI systems

I'm running my tests on CI machines that don't have a diff program installed.
It seems reasonable to me that this library would include a built in diff reporter so it doesn't have to depend on other programs being installed on the machine.

I bet there are decent diff nugets out there, its possible to just use on of them.

Great work!

Publishing received and approved files as build artifacts

When the tests fail on a build server, it is really convenient if the diff can be investigated without needing to remote onto the machine.

We do this with TeamCity by publishing the two files as artifacts.

It would be nice to add a callback you can hook into when a test fails, which passes the full path to the files, so you can add your own logic for your build server of choice.

What do you think?

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.