[Cucumber] new usage formatter

View: New views
8 Messages — Rating Filter:   Alert me  

[Cucumber] new usage formatter

by Aslak Hellesoy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://github.com/aslakhellesoy/cucumber/commit/60bcff6ceb1efb0a5439d2bbcfd30d1d8e7a910b

This should be of interest to anyone writing editor code completion and navigation support for Cucumber (notably Cucumber.tmbubdle)
Try this in cucumber's root dir: bin/cucumber examples/self_test/features -f usage --dry-run

This gives the following output (truncated):

/^passing without a table$/          # examples/self_test/features/step_definitions/sample_steps.rb:12
 Given passing without a table       # examples/self_test/features/background/failing_background_after_success.feature:4
 Given <state> without a table       # examples/self_test/features/outline_sample.feature:6
 Given <other_state> without a table # examples/self_test/features/outline_sample.feature:7
/^failing without a table$/    # examples/self_test/features/step_definitions/sample_steps.rb:15
 Given failing without a table # examples/self_test/features/background/failing_background.feature:4
 Given failing without a table # examples/self_test/features/background/scenario_outline_failing_background.feature:4

I'm hoping the Following TODOs from Cucumber.tmbundle can use this:
  • Goto step definition from feature file.
  • From a step definition be able to pull up a list of features using that step and to jump to them.
Aslak




_______________________________________________
rspec-devel mailing list
rspec-devel@...
http://rubyforge.org/mailman/listinfo/rspec-devel

Re: [Cucumber] new usage formatter

by Dr Nic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I'm hoping the Following TODOs from Cucumber.tmbundle can use this:
>
> Goto step definition from feature file.

Currently works with Shift+Alt+Cmd+Down

> From a step definition be able to pull up a list of features using that step
> and to jump to them.

Yeah I want this too.
_______________________________________________
rspec-devel mailing list
rspec-devel@...
http://rubyforge.org/mailman/listinfo/rspec-devel

Re: [Cucumber] new usage formatter

by Dr Nic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, it is Shift+Ctrl+Alt+Down

On Sun, Mar 22, 2009 at 7:12 AM, Dr Nic Williams
<drnicwilliams@...> wrote:

>> I'm hoping the Following TODOs from Cucumber.tmbundle can use this:
>>
>> Goto step definition from feature file.
>
> Currently works with Shift+Alt+Cmd+Down
>
>> From a step definition be able to pull up a list of features using that step
>> and to jump to them.
>
> Yeah I want this too.
>



--
Dr Nic Williams
iPhone and Rails consultants - http://mocra.com
Fun with iPhone/Ruby/Rails/Javascript - http://drnicwilliams.com
* Surf Report for iPhone - http://mocra.com/projects/surfreport/ *
_______________________________________________
rspec-devel mailing list
rspec-devel@...
http://rubyforge.org/mailman/listinfo/rspec-devel

Re: [Cucumber] new usage formatter

by Aslak Hellesoy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Sat, Mar 21, 2009 at 7:12 PM, Dr Nic Williams <drnicwilliams@...> wrote:
> I'm hoping the Following TODOs from Cucumber.tmbundle can use this:
>
> Goto step definition from feature file.

Currently works with Shift+Alt+Cmd+Down

Yes, but that is based on code in the bundle right? Isn't it better to use "official" Cucumber code for this?

Aslak


> From a step definition be able to pull up a list of features using that step
> and to jump to them.

Yeah I want this too.


_______________________________________________
rspec-devel mailing list
rspec-devel@...
http://rubyforge.org/mailman/listinfo/rspec-devel

Re: [Cucumber] new usage formatter

by Dr Nic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There is an internal data structure generated by eval'ing the step
files; we'll switch out the eval => cucumber --step-definitions call,
but the data structures will stay so it will 90% be the same code.

On Sun, Mar 22, 2009 at 7:59 AM, aslak hellesoy
<aslak.hellesoy@...> wrote:

>
>
> On Sat, Mar 21, 2009 at 7:12 PM, Dr Nic Williams <drnicwilliams@...>
> wrote:
>>
>> > I'm hoping the Following TODOs from Cucumber.tmbundle can use this:
>> >
>> > Goto step definition from feature file.
>>
>> Currently works with Shift+Alt+Cmd+Down
>
> Yes, but that is based on code in the bundle right? Isn't it better to use
> "official" Cucumber code for this?
>
> Aslak
>
>>
>> > From a step definition be able to pull up a list of features using that
>> > step
>> > and to jump to them.
>>
>> Yeah I want this too.
>
>



--
Dr Nic Williams
iPhone and Rails consultants - http://mocra.com
Fun with iPhone/Ruby/Rails/Javascript - http://drnicwilliams.com
* Surf Report for iPhone - http://mocra.com/projects/surfreport/ *
_______________________________________________
rspec-devel mailing list
rspec-devel@...
http://rubyforge.org/mailman/listinfo/rspec-devel

Re: [Cucumber] new usage formatter

by Ben Mabey-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

aslak hellesoy wrote:

>
>
> On Sat, Mar 21, 2009 at 7:12 PM, Dr Nic Williams
> <drnicwilliams@... <mailto:drnicwilliams@...>> wrote:
>
>     > I'm hoping the Following TODOs from Cucumber.tmbundle can use this:
>     >
>     > Goto step definition from feature file.
>
>     Currently works with Shift+Alt+Cmd+Down
>
>
> Yes, but that is based on code in the bundle right? Isn't it better to
> use "official" Cucumber code for this?
>
> Aslak

+1.  I think we should keep as much functionality in Cucumber so other
editors can leverage the functionality.
>
>
>     > From a step definition be able to pull up a list of features
>     using that step
>     > and to jump to them.
>
>     Yeah I want this too.
>
>
I'm going to take a stab at this now with the new usage formatter- very
nice!  I think the biggest drawback to this will be speed.  For example,
doing a dry-run on cucumber's own features takes ~2 seconds.  For a
rails project loading up the entire environment I think this would be
too slow to wait for everytime.  Any ideas on a caching strategy?  
Storing a cached version of the output is easy enough, but knowing when
to expire the cache is somewhat tricky...

-Ben
_______________________________________________
rspec-devel mailing list
rspec-devel@...
http://rubyforge.org/mailman/listinfo/rspec-devel

Re: [Cucumber] new usage formatter

by Aslak Hellesoy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Sat, Mar 21, 2009 at 11:25 PM, Ben Mabey <ben@...> wrote:
aslak hellesoy wrote:



On Sat, Mar 21, 2009 at 7:12 PM, Dr Nic Williams <drnicwilliams@... <mailto:drnicwilliams@...>> wrote:

   > I'm hoping the Following TODOs from Cucumber.tmbundle can use this:
   >
   > Goto step definition from feature file.

   Currently works with Shift+Alt+Cmd+Down


Yes, but that is based on code in the bundle right? Isn't it better to use "official" Cucumber code for this?

Aslak

+1.  I think we should keep as much functionality in Cucumber so other editors can leverage the functionality.



   > From a step definition be able to pull up a list of features
   using that step
   > and to jump to them.

   Yeah I want this too.


I'm going to take a stab at this now with the new usage formatter- very nice!  I think the biggest drawback to this will be speed.  For example, doing a dry-run on cucumber's own features takes ~2 seconds.  For a rails project loading up the entire environment I think this would be too slow to wait for everytime.  Any ideas on a caching strategy?  Storing a cached version of the output is easy enough, but knowing when to expire the cache is somewhat tricky...

Or maybe we could optimise. The support files don't have to be loaded, nor do we need to instantiate a full AST (mulitline args can be skipped).

I'll try out a few things. I'm sure we can make it perform reasonably well.

Aslak
 

-Ben


_______________________________________________
rspec-devel mailing list
rspec-devel@...
http://rubyforge.org/mailman/listinfo/rspec-devel

Re: [Cucumber] new usage formatter

by Dr Nic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Try using the code we have in the bundle for fake loading + evaling :)

On Sun, Mar 22, 2009 at 12:45 PM, aslak hellesoy
<aslak.hellesoy@...> wrote:

>
>
> On Sat, Mar 21, 2009 at 11:25 PM, Ben Mabey <ben@...> wrote:
>>
>> aslak hellesoy wrote:
>>>
>>>
>>> On Sat, Mar 21, 2009 at 7:12 PM, Dr Nic Williams <drnicwilliams@...
>>> <mailto:drnicwilliams@...>> wrote:
>>>
>>>    > I'm hoping the Following TODOs from Cucumber.tmbundle can use this:
>>>    >
>>>    > Goto step definition from feature file.
>>>
>>>    Currently works with Shift+Alt+Cmd+Down
>>>
>>>
>>> Yes, but that is based on code in the bundle right? Isn't it better to
>>> use "official" Cucumber code for this?
>>>
>>> Aslak
>>
>> +1.  I think we should keep as much functionality in Cucumber so other
>> editors can leverage the functionality.
>>>
>>>
>>>    > From a step definition be able to pull up a list of features
>>>    using that step
>>>    > and to jump to them.
>>>
>>>    Yeah I want this too.
>>>
>>>
>> I'm going to take a stab at this now with the new usage formatter- very
>> nice!  I think the biggest drawback to this will be speed.  For example,
>> doing a dry-run on cucumber's own features takes ~2 seconds.  For a rails
>> project loading up the entire environment I think this would be too slow to
>> wait for everytime.  Any ideas on a caching strategy?  Storing a cached
>> version of the output is easy enough, but knowing when to expire the cache
>> is somewhat tricky...
>
> Or maybe we could optimise. The support files don't have to be loaded, nor
> do we need to instantiate a full AST (mulitline args can be skipped).
>
> I'll try out a few things. I'm sure we can make it perform reasonably well.
>
> Aslak
>
>>
>> -Ben
>
>



--
Dr Nic Williams
iPhone and Rails consultants - http://mocra.com
Fun with iPhone/Ruby/Rails/Javascript - http://drnicwilliams.com
* Surf Report for iPhone - http://mocra.com/projects/surfreport/ *
_______________________________________________
rspec-devel mailing list
rspec-devel@...
http://rubyforge.org/mailman/listinfo/rspec-devel