Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NSpec package to work after .NET Core porting #145

Closed
BrainCrumbz opened this issue Dec 14, 2016 · 4 comments
Closed

Fix NSpec package to work after .NET Core porting #145

BrainCrumbz opened this issue Dec 14, 2016 · 4 comments

Comments

@BrainCrumbz
Copy link
Collaborator

BrainCrumbz commented Dec 14, 2016

Currently published version of NSpec NuGet package has the following features, when a projects installs it:

  1. Includes a copy of NSpec console runner EXE in local solution\packages\nspec....\tools\ directory
  2. (of course) Includes a copy of NSpec DLLs in local solution\packages\nspec....\ directory
  3. (of course) Adds references to NSpec DLLs in project

After .NET Core porting, NSpec now has two different targets: classic .NET 4.x framework and .NET Core. When packaged and then installed, it should produce similar results as current package:

When a .NET 4.x project installs it (identical):

  1. Includes a copy of NSpec console runner EXE in local solution\packages\nspec....\tools\ directory
  2. (of course) Includes a copy of NSpec DLLs in local solution\packages\nspec....\ directory
  3. (of course) Adds references to NSpec DLLs in project

When a .NET Core project installs it:

  1. Includes a copy of NSpec console runner EXE in local %Home%\.nuget\packages\nspec....\tools\ directory
    • Not sure this makes a lot of sense, it's not local to project, but instead in some user hidden folder
  2. (of course) Includes a copy of NSpec DLLs in local %Home%\.nuget\nspec....\ directory
  3. (of course) Adds references to NSpec DLLs in project

Re. NSpec console runner:
an alternative seen in other frameworks (xUnit) is to ship that as a distinct package, and install it as a solution-level package (aka tool-only package), which makes it available again locally to solution or projects. That feature was deprecated in nuget v3 but it seems it will be added back again in v3.5.

Re. very core feature nr 3:
currently it's broken when targeting a .NET Core project. DLLs are actually found in package dir, but references are not added into project.
This one bug is currently the show stopper to move on with .NET Core porting.

@johnnymo87
Copy link

Hi, sorry if this is a silly question, but is the NuGet package you mention available for linux yet? I've popped "nspec": "*" into my project.json, but when I dotnet restore, I get The dependency nspec >= * could not be resolved.

@BrainCrumbz
Copy link
Collaborator Author

Not a silly question at all, actually! Quick answer: no.

Longer answer: we have some issues in generating nuget package (with nuget or dotnet pack) for this new .NET Core enabled version of library (and sadly not a lot of time to look at it, recently). From local tests and runs the code should be fine, but until we have a working package to publish ...

@BrainCrumbz
Copy link
Collaborator Author

Mentioned core feature, Adds references to NSpec DLLs in project, is now fixed both when client project is .NET Core or .NET Framework (>= 4.5.2, minimum supported).

There still some thinking needed on what to do with NSpec console runner for .NET Core client projects.

@BrainCrumbz
Copy link
Collaborator Author

After some discussion, here's the decision on NSpec console runner:

  1. NSpec package will ship NSpec console runner when targeting .NET framework client projects. It will not ship it when targeting .NET core client projects.
  2. .NET core client project will use dotnet-test-nspec runner from command line with dotnet test
  3. Later or, we might provide instruction/ code samples/ docs on how to create a console application (instead of a class library) to run & debug tests in a totally custom way.

Closing this and creating needed issues to track 1. and 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants