Git Product home page Git Product logo

atom-ruby-test's People

Contributors

calmyournerves avatar drenmi avatar dropsofserenity avatar dsandstrom avatar gav1n avatar hola-soy-milk avatar izuzak avatar maletor avatar mbarbieri avatar mmmries avatar moiristo avatar moxley avatar mvalipour avatar nolanpro avatar roychoo avatar shugo avatar tomkadwill avatar willmanduffy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

atom-ruby-test's Issues

question: any idea why just {relative_path} doesn't find test file?

for some reason, when the package runs:

ruby -I test {relative_path}

i get a cannot load such file error, but if i manually set the following in the configuration:

ruby -I test /path/to/my/test/folder/{relative_path}

it works.

any ideas how to make relative pathing work, or grab absolute path from the environment?

best,
tony.

Restore default keybindings

Is it possible to restore the default keybindings?

After updating to 0.9.14, the keybindings invoked each function twice. So cmd-ctrl-t opened two test windows running the tests twice. I opened the ruby-test settings and unchecked "enabled keybindings". Now that option is gone so I cannot check it. I've tried reinstalling ruby-test.

Cucumber coloured output.

I am using an old version of ruby (REE 1.8.7) and cucumber (0.10.5). In order to get coloured output, I had to set the cucumber commands like follows:

'ruby-test':
    'cucumberSingleCommand': 'cucumber --color {relative_path}:{line_number}'
    'cucumberFileCommand': 'cucumber --color {relative_path}'
    'cucumberAllCommand': 'cucumber --color features'

I am not sure if including this option hardcoded could cause some issues with newer versions. Otherwise, at least we could include this information in the documentation, so users like me could find this information easily and have a better experience with the plugin.

Congratulations for this nice package,
Carlos.

Could not locate Gemfile or .bundle/ directory

I get this error if I use ctrl-shift-Y, ctrl-shift-T or ctrl-shift-R.

My project uses Rspec and has a valid Gemfile at its root, and I've changed the command in settings to use "bundle exec rspec" instead of just "rspec".

I also use rbenv, in case that's relevant.

Uncaught TypeError: undefined is not a function

[Enter steps to reproduce below:]

  1. Pressed Ctrl+Cmd+T to run tests.

Atom Version: 0.196.0 ⚠️ in 1.0 API Preview Mode ⚠️
System: Mac OS X 10.10.3
Thrown From: ruby-test package, v0.9.6

Stack Trace

Uncaught TypeError: undefined is not a function

At /Users/matt/.atom/packages/ruby-test/lib/source-info.coffee:32

TypeError: undefined is not a function
  at SourceInfo.module.exports.SourceInfo.currentLine (/Users/matt/.atom/packages/ruby-test/lib/source-info.coffee:34:36)
  at TestRunner.module.exports.TestRunner.command (/Users/matt/.atom/packages/ruby-test/lib/test-runner.coffee:33:48)
  at TestRunner.command (/Users/matt/.atom/packages/ruby-test/lib/test-runner.coffee:1:1)
  at TestRunner.module.exports.TestRunner.run (/Users/matt/.atom/packages/ruby-test/lib/test-runner.coffee:15:28)
  at RubyTestView.module.exports.RubyTestView.runTest (/Users/matt/.atom/packages/ruby-test/lib/ruby-test-view.coffee:72:13)
  at RubyTestView.module.exports.RubyTestView.testFile (/Users/matt/.atom/packages/ruby-test/lib/ruby-test-view.coffee:53:6)
  at atom-workspace.<anonymous> (/Users/matt/.atom/packages/ruby-test/lib/ruby-test-view.coffee:24:68)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/command-registry.js:238:29)
  at /opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:519:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:354:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:178:20)

Commands

     -0:16.9.0 core:close (atom-text-editor.editor.is-focused)
     -0:06.0 fuzzy-finder:toggle-file-finder (atom-pane.pane.active)
     -0:03.2.0 core:move-down (atom-text-editor.editor.mini)
     -0:03.0 core:confirm (atom-text-editor.editor.mini)
     -0:01.6.0 ruby-test:test-file (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "seti-ui",
      "seti-syntax"
    ],
    "disabledPackages": [
      "racer"
    ]
  },
  "ruby-test": {
    "rspecAllCommand": "bin/rspec --tty spec",
    "rspecSingleCommand": "bin/rspec --tty {relative_path}:{line_number}",
    "rspecFileCommand": "bin/rspec --tty {relative_path}"
  }
}

Installed Packages

# User
autocomplete-plus, v2.12.1
autocomplete-ruby, v0.1.0
language-rust, v0.4.3
linter, v0.12.1
linter-rubocop, v0.2.3
pretty-json, v0.3.3
ruby-bundler, v0.2.1
ruby-test, v0.9.6
seti-syntax, v0.4.0
seti-ui, v0.6.3
test-jumper, v0.3.0

# Dev
No dev packages

Duplicate test panels

On Atom version 0.204.0, package version 0.9.11, ctrl-cmd-t is opening two test panels:

duplicate-panels

Could be something wrong with my local configuration, but wanted to file this in case. Any ideas?

Fish Shell Unsupported use of &&

Any workaround?

Unsupported use of '&&'. In fish, please use 'COMMAND; and COMMAND'.
fish: cd /Users/X/project && bundle exec rspec spec/models/user_spec.rb; exit

Colors with Solarized scheme

atom-ruby-test colours are very hard to look when using Solarized colour theme. I mean solarized has its red colour which looks nice. atom-ruby-test uses different red combinded w/ lighter background that makes output very hard to read. Example screenshot attached.

screen shot 2015-10-26 at 10 15 51

Below is example of Solarized theme's red:

screen shot 2015-10-26 at 10 14 43

Would it be possible to better match colours defined in Theme?

Does not work in fish

There are a few problems that prevent this tool from working with fish.

First of all, the order of ['-c', '-l', testCommand] in shell-runner.coffee is incorrect for fish, and, according to the man page, for bash. Interesting that it seems to work in bash.

-c is supposed to accept a string; the command to run in the shell. Placing it before -l passes -l as the command to run, which is not the intent.

The second problem is, fish does not use && to run multiple commands. It uses ; instead.


These changes seem pretty simple, and the only reason I have not created a PR with them is I wanted to know if you had any objections to this.

chruby support with zsh

For reference: https://github.com/postmodern/chruby. I installed on OSX using Homebrew, FWIW.

I setup my test/rspec commands to use bin/rspec --tty (etc.). When I run any of the tests (cmd-ctrl-r, for example), I get output in the console saying that it can't find bundler--but the ruby path that's in the backtrace is for the system ruby. (As an aside, and I don't know if this is on you or Atom, it'd be nice to be able to copy the output from the console so I can paste in here. I'm not able to select anything in there). I've tried changing the commands to look like:

  • bin/rsepc --tty spec
  • bundle exec rspec --tty spec
  • source /usr/local/opt/chruby/share/chruby/chruby.sh; cd .; bundle exec rspec --tty spec

Atom version: 0.115.0
Ruby test: 0.7.0

Wrong path with multiple directories

When using Atom with multiple directories open, ruby-test uses the wrong path for files. It seems that it always use the first directory root path.

Pause on debug

In ruby test for Sublime Text, test runs jump over debug or byebug statements and finish execution. In Atom, the code stops (I have verified this behavior for byebug only).

I cannot find a way to resume. Of course the best would be if there were a way to actually step through code from Atom, but failing that, ruby test runs should not freeze on these statements.

UPDATE: Indeed when ruby-test stops on a byebug statement, there's no apparent way to kill it without closing Atom.

No way to cancel

There should be some way to cancel the current test run, probably CTRL-C and also CMD-CTRL-X

rbenv / rvm support with zsh

I have searched high and low to get the plugin working with RBENV or RVM and have come up short. I know that the docs say that they are supported, but is there anything that needs to be done to enable the support.

Here is an example of what I am running into: http://cl.ly/image/0u0L22171J3Z

Which means that the plugin is trying to use system ruby.

What I have tried: add rbenv to bash (I currently use zsh). which doesn't seem to help at all.

Any pointers would be greatly appreciated and from what I find I will add to the documentation so that others don't run into the same issue 😄

is it me?

so i recently got a new macbook and trying to re-create my environment.

installed atom and this package fresh, and when i go to settings page,
it only shows the key-bindings section, but not the settings section
(where you can enter 'test all command', etc...):

atom: 0.177.0
ruby-test: 0.9.4
osx: 10.9.5

any suggestions for troubleshooting?

best,
tony.

Test Progress not shown during test run

I am new to Atom and therefore dont know whether this is a platform limitation or not. When a test or suite of ruby tests are run there is no output until the final tests are shown even though the output eventually includes the progress dots and feedback. This means that for a test suite that takes a period of time to complete there is no immediate feedback. I have run the tests by using the keymap bindings, e.g.

'ctrl-cmd-y': 'ruby-test:test-all'
atom_in_progress

.zshrc doesn't get loaded

Atom version 0.211.0, ruby-test version 0.9.11.

Running oh-my-zsh, and notice that my ~/.zshrc isn't loaded automatically, which causes the PATH to not be set, so gems like rspec and bundler aren't available.

The only way I could get it working was to explicitly source my ~/.zshrc (see screenshot below), which obviously is not ideal. Not sure if something is misconfigured on my end, or if this is a legitimate bug.

Add bundle support?

When trying to run my tests I received some output stating that I should use bundle exec to run the tests. I manually edited the package and added bundle exec and now the tests work for me.

I'm not totally sure if adding bundle exec as a prefix to all commands will have the expected outcome for people who are not working inside of a bundle. What do you think?

I could possibly spend some more time on this and add bundle support as a setting.

Esc key doesn't close test pane

Normally I'd expect the escape key to close the Ruby Test pane, similar to how the Find and Replace pane disappears when pressing Escape.

Atom.Object.defineProperty.get is deprecated.

From the Atom deprecation cop:

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:55:11)
RubyTestView.initialize (/Users/keiter/.atom/packages/ruby-test/lib/ruby-test-view.coffee:20:9)

Uncaught TypeError: Cannot read property 'save' of undefined

Uncaught TypeError: Cannot read property 'save' of undefined

Atom Version: 0.158.0
System: Mac OS X 10.9.5
Thrown From: ruby-test package, v0.9.1

Steps To Reproduce

(On Mac)

  1. Open a Cucumber based project
  2. Go to Packages -> Ruby Test -> Run test file

Note: No file is open

Stack Trace

At /Users/enri8294/.atom/packages/ruby-test/lib/ruby-test-view.coffee:61

TypeError: Cannot read property 'save' of undefined
  at RubyTestView.module.exports.RubyTestView.runTest (/Users/enri8294/.atom/packages/ruby-test/lib/ruby-test-view.coffee:61:37)
  at RubyTestView.module.exports.RubyTestView.testFile (/Users/enri8294/.atom/packages/ruby-test/lib/ruby-test-view.coffee:46:6)
  at atom-workspace.<anonymous> (/Users/enri8294/.atom/packages/ruby-test/lib/ruby-test-view.coffee:21:59)
  at atom-workspace.handler (/Applications/Atom.app/Contents/Resources/app/src/space-pen-extensions.js:115:32)
  at atom-workspace.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4681:9)
  at atom-workspace.elemData.handle (/Applications/Atom.app/Contents/Resources/app/node_modules/space-pen/vendor/jquery.js:4359:46)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:156:19)
  at Ipc.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:65:30)
  at Ipc.emit (events.js:107:17)
  at process.<anonymous> (/Applications/Atom.app/Contents/Resources/atom/renderer/api/lib/ipc.js:22:29)
  at process.emit (events.js:110:17)

/cc @atom/core

cd: atom://config: No such file or directory

When running Ruby Test: Single File the output window shows:

/Users/brian/.rvm/scripts/extras/bash_zsh_support/chpwd/function.sh: line 5: cd: atom://config: No such file or directory

In shell_runner.full_command I added alert(this.params.cwd()) which pops up an alert with atom://config

No spaces in the project path (though there are dashes). Atom v1.0.0. OSX.

Rspec being run inside a feature file

Hi! I'm loving ruby-test and it works perfectly inside my spec files. However, when I run it inside my feature files for cucumber tests, I noticed it was still trying to run the rspec command. I had changed the default settings to just include the bundle exec command, but even when I changed everything back to default, my feature tests were still being run with Rspec. Have I missed something? Can I provide any other information? I just downloaded the newest Atom 1.0.0 version a couple days ago and my ruby-test version is 0.9.11, which looks like the newest.

I've attached an image so you can see what it's saying in the test panel - that it's trying to run rspec with a feature file. The error it gives is that it sees ':' instead of 'end' - obviously because it's trying to run Rspec.

screen shot 2015-06-29 at 4 10 42 pm

Thank you in advance!

RSpec detection not working when require (rails|spec)_helper comes from .rspec.

RSpec allows rails_helper or spec_helper to be required by default through configuration of the .rspec file:

--color
--require rails_helper

Therefore, atom-ruby-test mistakes RSpec specs for Minitest specs when the require is omitted because it uses this RegExp:

rspecRequireRegExp = new RegExp(/^require(\s+)['"](rails|spec)_helper['"]$/)

TextEditor.getCursor is deprecated.

Use TextEditor::getLastCursor() instead

TextEditor.getCursor (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:2940:7)
SourceInfo.currentLine (/Users/ccschmitz/.atom/packages/ruby-test/lib/source-info.coffee:34:35)

TextEditor.getCursor is deprecated.

Use TextEditor::getLastCursor() instead

TextEditor.getCursor (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:2990:7)
SourceInfo.currentLine (/Users/kematzy/.atom/packages/ruby-test/lib/source-info.coffee:34:35)
TestRunner.module.exports.TestRunner.command (/Users/kematzy/.atom/packages/ruby-test/lib/test-runner.coffee:33:47)
command (/Users/kematzy/.atom/packages/ruby-test/lib/test-runner.coffee:1:0)

Discussion: Test result pane placement

I'm developing with Atom on a 27" display, and having the test-result pane span over the complete width of the window seems like a bit too much. I tried to think of a way to do this differently, but couldn't really come up with anything else, except for maybe an implementation like suggested in #1 (when the results are put in a tab, we should be able to move them around with the default keyboard shortcuts).

So I thought I'd at least create this issue to see if other people have put any thought into this.

Per-project configuration for ruby-test

When switching between multiple projects, it is a pain to reconfigure ruby-test. My day job Ruby projects are hosted in a Vagrant VM, and ruby-test needs special configuration to issue commands to the VM. Other Ruby projects run on the native machine and use the default configuration. Switching back and forth requires saving the old configuration in a copy-paste fashion, one line at a time from the ruby-test settings to a text file, then restoring the configuration, one line at a time when I switch back to the other project.

Linked file paths

Ability to click on a file path in the output and have it open in the editor.

Question: Can this work with Spring preloader

Hey I love the this Atom package for the simplicity and ease-of-use.

I am always looking for ways to speed up my development process.

I started using the Spring preloader for a recent Rails project I am working on. This makes the test run without any startup time from the commandline like this:

spring rake

Within this plugin I can see it runs (for single test) a command looking like this example: ruby -I test test/controllers/comments_controller_test.rb

Is it possible to also use the spring preloader from inside atom-ruby-test?
If so, how should I modify the commands?

Uncaught TypeError: Cannot read property 'replace' of undefined

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.182.0
System: Mac OS X 10.10.2
Thrown From: ruby-test package, v0.9.5

Stack Trace

Uncaught TypeError: Cannot read property 'replace' of undefined

At /Users/aehrmann/.atom/packages/ruby-test/lib/test-runner.coffee:32

TypeError: Cannot read property 'replace' of undefined
  at TestRunner.module.exports.TestRunner.command (/Users/aehrmann/.atom/packages/ruby-test/lib/test-runner.coffee:32:10)
  at TestRunner.command (/Users/aehrmann/.atom/packages/ruby-test/lib/test-runner.coffee:1:1)
  at TestRunner.module.exports.TestRunner.run (/Users/aehrmann/.atom/packages/ruby-test/lib/test-runner.coffee:15:28)
  at RubyTestView.module.exports.RubyTestView.runTest (/Users/aehrmann/.atom/packages/ruby-test/lib/ruby-test-view.coffee:66:13)
  at RubyTestView.module.exports.RubyTestView.testAll (/Users/aehrmann/.atom/packages/ruby-test/lib/ruby-test-view.coffee:53:6)
  at atom-workspace.<anonymous> (/Users/aehrmann/.atom/packages/ruby-test/lib/ruby-test-view.coffee:25:67)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:558:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:396:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:176:20)

Commands

     -3:57.4 core:move-down (atom-text-editor.editor.mini)
     -3:57.2 core:confirm (atom-text-editor.editor.mini)
     -3:57.2 rspec:run-all (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-monokai.theme-one-dark-ui)
     -3:14.8 settings-view:open (atom-pane.pane.active)
     -3:09.2 core:confirm (atom-text-editor.editor.mini)
     -3:06.8 editor:delete-to-beginning-of-word (atom-text-editor.editor.mini)
     -3:05.0 core:confirm (atom-text-editor.editor.mini)
     -2:58.6 core:backspace (atom-text-editor#ruby-test.rspecAllCommand.editor.mini)
     -2:47.5 core:close (div.settings-view.pane-item)
     -2:45.9 emmet:evaluate-math-expression (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-monokai.theme-one-dark-ui)
     -2:42.7 core:close (atom-pane.pane.active)
     -2:36.1 ruby-test:test-all (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -0:41.0 settings-view:open (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-monokai.theme-one-dark-ui)
     -0:35.4 core:confirm (atom-text-editor.editor.mini)
     -0:02.2 pane:show-previous-item (div.settings-view.pane-item)
     -0:00.9 ruby-test:test-all (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "one-dark-ui",
      "monokai"
    ],
    "disabledPackages": [
      "language-objective-c",
      "archive-view",
      "autosave",
      "whitespace",
      "rspec"
    ]
  },
  "ruby-test": {
    "rspecAllCommand": "rspec",
    "shell": "zsh"
  }
}

Installed Packages

# User
atom-beautify, v0.21.3
autocomplete-plus, v2.1.6
color-picker, v1.4.4
emmet, v2.3.3
git-plus, v4.4.8
highlight-line, v0.9.3
monokai, v0.12.0
ruby-test, v0.9.5

# Dev
No dev packages

enhancement: add {test_name} variable to use with --name option

trying to use cmd-ctrl-r (run test at cursor) with minitest and it doesn't like the file:line-number syntax (i even tried the m gem but there is an issue with that and the current version of minitest).

using:

ruby -I test {relative_path} --name {test_name}

would work, but it would need to parse out the quoted string at the cursor, snake_case it and prefix with test_, for example:

  test 'should create with valid creds' do

would yield test_should_create_with_valid_creds

i'm an atom package developer noob, but i'd be willing to help out if you are stretched.

regards,
tony.

Settings not available until package activated

When first installing the package, the settings are not available to configure. They will not show up until Ruby Test is activated via one of the activation commands, like "toggle", "test-all", "test-file", etc.

I'm not sure the solution for this, other than activating the package when the editor starts up, which adds to the startup time. Ideally, Atom would activate the package when opening the package's settings page.

Test Panel on a Tab?

In SublimeText I was able to show the test results on tab rather than on a panel below.

Any chance that could work with Atom?
The output of the tests might be long; especially when there are failing :p

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.