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

Add a few BDD/TDD line based executions #107

Closed
wants to merge 3 commits into from

Conversation

erran
Copy link
Collaborator

@erran erran commented Apr 19, 2014

I've updated "Selection Based" support to pass a Selection instead of the selection text. The selection block now takes filename and selection instead. To get the selected text now selection.getText() is used.

  • Cucumber Gherkin line based execution support
  • Behat Gherkin line based execution support
  • RSpec line based execution vs. regular selection based execution support

gherkin_line_support

@erran erran changed the title Add Gherkin line based execution support Add a few more selection based executions Apr 19, 2014
@erran
Copy link
Collaborator Author

erran commented Apr 19, 2014

@rgbkrk @intothev01d Would this better fit as a new argType? I like the idea of being able to do either in RSpec. It becomes complicated though.

@erran erran changed the title Add a few more selection based executions Add a few BDD/TDD based executions Apr 19, 2014
@erran erran changed the title Add a few BDD/TDD based executions Add a few BDD/TDD selection based executions Apr 19, 2014
@erran erran changed the title Add a few BDD/TDD selection based executions Add a few BDD/TDD line based executions Apr 19, 2014
# No selected text on a file that does exist, use filepath
if (not selectedText? or not selectedText) and filepath?
if selection.isEmpty() and filepath?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this is cleaner.

@rgbkrk
Copy link
Member

rgbkrk commented Apr 19, 2014

The grammars file looks a bit complicated now, with most of the grammars still just needing a code block but having to get the text out. I need some time to think on this.

@erran
Copy link
Collaborator Author

erran commented Apr 19, 2014

@rgbkrk let me know what you think. A "Line Number Based" argType keeps coming to mind when I look at this. I agree that the grammars file has become more complicated now. It gives more capability but at what cost (legibility-wise)?

filepath = editor.getPath()

# If no text was selected, either use the file
# or select ALL the code in the editor

# Brand new file, text not selected, "select" ALL the text
if (not selectedText? or not selectedText) and not filepath?
selectedText = editor.getText()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the brand new file, text not selected case still work with this? I don't see a "grab all" below.

@rgbkrk
Copy link
Member

rgbkrk commented Apr 19, 2014

At the very least, I think I'd like to split this up into two PRs.

One PR to switch over to using editor.getSelection() but still passing the code directly (arg = selection.getText()). That will get merged quickly as it cleans up the "is there a selection" logic immensely.

The second PR can be the other half of this PR, doing line based runs, choosing to pass the Selection object, etc.

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

Successfully merging this pull request may close these issues.

None yet

2 participants