Comments (4)
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.
You can try it via the snapshot update site.
from jnario.
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:
- Created a unit-level specs file
- Added the following code:
describe Ferrari {
fact "Should have four wheels" => [
var ferrari = new Ferrari();
ferrari.getNumberOfWheels() => 4;
]
}
- Used quick fix to generate a class Ferrari in package cars (successfully)
- Added import cars; to the .spec file at the top
- Used quick fix on the invocation of getNumberOfWheels() method and chose "generate method" quick fix
- 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.
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)
- Iterable<T> and List<T> should be compared properly HOT 2
- LinkageError during build HOT 5
- Unable to find xtend-gen file with generated JAVA Code HOT 4
- Doc: Broken format of <pre class="lang-spec prettyprint">..</pre> with IE10 HOT 2
- Jnario is not working after the installation
- Upgrade Xtext to 2.7 HOT 5
- Make Jnario a pure Xbase language HOT 104
- Step references don't call assert, resulting in false positive results HOT 2
- Installing 1.0.0 from Update Site fails on vanilla Eclipse 4.4.1 HOT 6
- Release and Snapshot repositories down
- Error in Eclipse preferences window, Jnario option is unusable HOT 5
- runing mutiple jnario tests in parallel
- Acceptance Specifications translations support HOT 4
- Update site is down HOT 3
- State of this project HOT 17
- please document how tables are used on feature files
- upgrade Jnario to latest tend HOT 1
- Full qualified names in "should be"s leads to compile errors HOT 1
- Error instantiating adapter factory for "org.eclipse.core.resources.IResource" declared by "org.jnario.suite.ui". HOT 2
- Updating the Xtext Community Website HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jnario.