GithubHelp home page GithubHelp logo

Comments (4)

sebastianbenz avatar sebastianbenz commented on September 3, 2024

Thanks for the suggestion. I've also thought about this feature and
definitely would like to have it in Jnario. The only question is
whether it will be implemented for Jnario or for Xtend, as it would
make more sense to have this feature in Xtend and then reuse the
implementation in Jnario.

Am 22.07.2012 um 12:32 schrieb grzesiek-galezowski
[email protected]:

Hi,

In the documentation, you write "To turn our scenario into an executable specification you have to add the necessary code to each of our steps. For each step the implementation is done directly after the description of the step. The language used to define the logic is Xtend. Create a Java class with the name Calculator in the same project as your feature file. Add the necessary import to the feature file or include it by auto completion while typing (CTRL + SPACE)."

What I'd like to do is quite opposite. I'd like to be able to write:
Calculator calculator = new Calculator();
then click the quick fix and make eclipse generate the type for me. Now, I can only quick-fix it with generating an Extend class, which is not what I want.

Also, I'd like to be able to first write:
calculator.add(10);
and then choose quick fix to implement the method in Calculator type for me. Now, I can only quick-fix it with generating an extension method, which is not what I want.

Anyway, the power of JUnit is in that you can write the whole spec as you'd like the API to look, and then just click->generate class, click->generate method, click->generate method etc. This fits nicely with the Need Driven Development concept introduced by Steve Freeman and Nat Pryce. I'd be very grateful if you could somehow enable this, since it would be a great productivity boost, plus, this is a feature that is already enabled for specs written in native Java code, so it would be nice to have it in JNario as well.


Reply to this email directly or view it on GitHub:
#12

from jnario.

sebastianbenz avatar sebastianbenz commented on September 3, 2024

You can try it via the snapshot update site.

from jnario.

grzesiek-galezowski avatar grzesiek-galezowski commented on September 3, 2024

Hi,

Great that this is implemented! Don't know what's the current state, but the version from Github I tried had some issues with generating a method for generated class.

Here are the steps I followed:

  1. Created a unit-level specs file
  2. Added the following code:

describe Ferrari {
fact "Should have four wheels" => [
var ferrari = new Ferrari();
ferrari.getNumberOfWheels() => 4;
]
}

  1. Used quick fix to generate a class Ferrari in package cars (successfully)
  2. Added import cars; to the .spec file at the top
  3. Used quick fix on the invocation of getNumberOfWheels() method and chose "generate method" quick fix
  4. The method was not added to the class.

When writing a feature (Given-When-Then) it seems to work flawlessly.

Thanks for taking care of this. I'm sure it will provide a huge productivity boost to many people using JNario to do TDD!

from jnario.

sebastianbenz avatar sebastianbenz commented on September 3, 2024

This is already fixed in 7980798, but not yet on the snapshot update site. I will push a new build tonight.

from jnario.

Related Issues (20)

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.