Code Monkey home page Code Monkey logo

rspec.tmbundle's Introduction

RSpec TextMate Bundle

This bundle works with TextMate 2 and RSpec 3. For TextMate 1 and/or RSpec 1 or 2 please use the legacy versions from the branches rspec1-textmate1 or rspec2, respectively.

Installation

Open up TextMate’s preferences, go to “Bundles” and make sure “RSpec” is checked.

Usage

See HELP.md

History

Parts of RSpec.tmbundle are based on Florian Weber's TDDMate.

License

The license of RSpec.tmbundle is the same as RSpec's.

rspec.tmbundle's People

Contributors

alexch avatar dchelimsky avatar drnic avatar elia avatar ged avatar gemyago avatar gja avatar granth avatar grimen avatar infininight avatar james2m avatar jish avatar jperkins avatar justinko avatar lukemelia avatar mahnve avatar mvanholstyn avatar noniq avatar nruth avatar olly avatar pcasaretto avatar purp avatar simonjefford avatar stjernstrom avatar thilo avatar timcharper avatar underpantsgnome avatar unpublishedworks avatar zilkey avatar zmoazeni 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rspec.tmbundle's Issues

rubygems not required if not using bundler or Gemfile, causes loading of rspec to cack

When running rspec tests on my project, which isn't using bundler or a Gemfile and rspec 1.3.1, I get the following errors.

/Users/chrisstringer/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/rspec/mate.rb:43:in require': no such file to load -- spec/autorun (LoadError) from /Users/chrisstringer/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/rspec/mate.rb:43 from /tmp/textmate-command-17729.rb:2:inrequire' from /tmp/textmate-command-17729.rb:2

I was able to fix the issue by moving the require "'rubygems' entry" on line 16 of /Support/lib/rspec/mate.rb up to line 8, so that it gets included in all cases, regardless of how the conditional on line 15 evaluates.

escape brackets

A common failed test shows something like this in the textmate runner.

undefined method `contest_items' for #

It' be nice if it escaped the alligator brackets, so I could see #.

P.S. Sweet work with the 'show only passed/failed/pending' checkboxes!

Runs the wrong example

Given the following spec file, if I put the cursor in test2 and "run single example", it runs test1 instead. I see this behavior when I have a nested describe followed by a test in same outer describe (but not in a nested describe). In these cases, the rspec bundle seems to run the last test of the last nested describe before the cursor.

    describe "outer describe" do
      describe "nested describe" do
        it "test1" do
        end
      end
      it "test2" do
      end
    end

Something is wrong with RSpec language file

I changed key equivalent for "Run Examples" to command-R and all I get is a beep. I assume that's because the filename isn't matching somehow. An example filename is users_controller_spec.rb

Recent commit have broken spec bundle for me

I think the latest couple of commit broke rspec-tm for me. A failing example now throws an uncaught exception and the run stops.

NoMethodError: undefined method `make_example_group_header_red' for nil:NilClass

If I roll back to commit 024bfd2 it works again, and stack links are clickable.

OSX Mavericks, TM 2.0-alpha.9503, REE 1.8.7

exceptions not shown in run window

something related to the html. It also doesn't show the newlines properly:

This exception was generated on purpose in my controller, but results in this.

After the # it'd be really handy if it mentioned the exception and its message :) Not sure why its being stripped out, as its shown from the console.

Exception encountered: # backtrace: /Users/inspire/Dropbox/newap/app/controllers/application_controller.rb:46:in before_filter_load' /Users/inspire/Dropbox/newap/app/controllers/topics_controller.rb:15 /Users/inspire/.rvm/gems/ree-1.8.7-2010.02/gems/activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:418:inload'

rspec2 beta22 giving deprecation warning

Running example in textmate with latest rspec-tmbundle CMD+R gives:

**************************************************************** DEPRECATION WARNING: you are using deprecated behaviour that will be removed from a future version of RSpec. /Users/spovich/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/../spec/mate/runner.rb:38:in `run' * disable_autorun! is deprecated. *****************************************************************

Multiline strings breaks syntax highlighting

This markdown example is highlighted correctly. In Sublime, when in rspec syntax mode, the first line of the string is highlighted correctly, but the reset of the file's syntax is messed up.

Example:

it "should highlight
the whole string" do

end

rspec window doesn't show right backtrace

For example, here's an error in my partial, shown in the rspec results html window:

get
undefined method `item_type' for #
./app/helpers/application_helper.rb:116 :in `partial'
./app/controllers/application_controller.rb:244 :in `render'
./spec/controllers/assignment_controller_spec.rb:60 
362        return __send__(match.target, match.attr_name, *args, &block)
363      end
364      super
365    end
366
367# gem install syntax to get syntax highlight

The same thing on the command line:

1) AssignmentController grade get
Failure/Error: get :grade, :id => @gid
undefined method `item_type' for #<Homework:0x1085c2e08>
# ./app/views/comment/_comment.haml:26:in `_app_views_comment__comment_haml___747077949_2217537420_744830'
# ./app/helpers/application_helper.rb:116:in `partial'
# ./app/views/assignment/grade.haml:13:in `_app_views_assignment_grade_haml___962066849_2217588300_0'
# ./app/views/assignment/grade.haml:12:in `each'
# ./app/views/assignment/grade.haml:12:in `_app_views_assignment_grade_haml___962066849_2217588300_0'
# ./app/views/assignment/grade.haml:8:in `_app_views_assignment_grade_haml___962066849_2217588300_0'
# ./app/controllers/application_controller.rb:244:in `render'
# ./spec/controllers/assignment_controller_spec.rb:60

Any idea why the backtrace is messed up from textmate?

no such file to load -- spec (LoadError)

I've just installed the RSpec bundle but when I try to run the "Run Behavior Description" command it fails with this error:

/opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in gem_original_require': no such file to load -- spec (LoadError) from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:inrequire' from /Volumes/Macintosh HD/Users/christian/Library/Application Support/TextMate/Pristine Copy/Bundles/Ruby Rspec.tmbundle/Support/lib/spec_mate.rb:16 from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in
gem_original_require' from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:inrequire' from /tmp/temp_textmate.1Uz9JB:3

run_focussed does not work with rspec 3 because --line option does not exist

The run_focussed method in Support/lib/rspec/mate.rb

  def run_focussed(stdout, options={})
    options.merge!(
      {
        :files => [single_file],
        :line => ENV['TM_LINE_NUMBER']
      }
    )

should become

  def run_focussed(stdout, options={})
    options.merge!(
      {
        :files => [single_file+":"+ENV['TM_LINE_NUMBER']]
      }
    )

The new run on line syntax is file_path:line_number instead of file_path --line line_number

This would most likely affect rspec 2

Bundle doesn't work with RSpec 1.3.2

I've been told that rspec 1.3.2 hasn't worked with the bundle since after b48e860

Checking out that commit fixes it. I took a look myself at the issue briefly, but it looks like a whole lot has changed structurally since then and lots of files have been rearranged. For example, rspec/core doesn't exist at all. I'm not sure how to best handle that since TextMate 2 auto-updates bundles.

Also I don't personally have a project using this version so I don't have a very easy way to test it.

It's confusing what RSpec bundle/package to install in Sublime Text

Hi

I switched from TextMate to Sublime Text last year, and just upgraded to Sublime Text 3. I use Package Control to install Sublime Text packages. There's a Sublime Text package for RSpec which does effectively the same thing. It has a few improvements over the TextMate bundle (eg it has a let snippet) – I don't know if it's behind on anything.

What's confusing is that the TextMate bundle (ie this repo shows) up in Sublime Text 3, although the Sublime package doesn't because it's tagged ST2 only.

Is there a reason why there's a separate package/bundle for each editor? And if so, does it make sense to have the TextMate bundle available in more recent versions of Sublime Text than the Sublime package? It's only because I was expecting a let snippet I knew something was wrong, so this would probably be confusing to new users.

(I've put a comment on the Sublime package issue to say that it should be tagged as working in all ST versions as I have no trouble running it in ST3 myself.)

Ash

rspec/core (LoadError)

I receive a LoadError when running the "commend R"

I have my rvm default set to system ruby and these versions installed.
rspec (2.2.0)
rspec-core (2.2.1, 2.0.1)
rspec-expectations (2.2.0, 2.0.1)
rspec-mocks (2.2.0, 2.0.1)
rspec-rails (2.0.1, 1.3.2)

Error output

/Users/jspooner/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/rspec/mate.rb:29:in require': no such file to load -- rspec/core (LoadError) from /Users/jspooner/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/rspec/mate.rb:29 from /tmp/textmate-command-8108.rb:2:inrequire' from /tmp/textmate-command-8108.rb:2

textmate_rspec_last_remembered_file_cache.txt not found when Cmd-alt-R

I love the TextMate bundle for RSpec, but sadly, when hitting Cmd-Alt-R (to run the last run file), I get this:

/Users/josh/Library/Application Support/TextMate/Pristine Copy/Bundles/RSpec.tmbundle/Support/lib/rspec/mate/runner.rb:86:in `read': No such file or directory - /tmp/textmate_rspec_last_remembered_file_cache.txt (Errno::ENOENT) from /Users/josh/Library/Application Support/TextMate/Pristine Copy/Bundles/RSpec.tmbundle/Support/lib/rspec/mate/runner.rb:86:in `last_remembered_single_file' from /Users/josh/Library/Application Support/TextMate/Pristine Copy/Bundles/RSpec.tmbundle/Support/lib/rspec/mate/runner.rb:21:in `run_last_remembered_file' from /tmp/textmate-command-92643.rb:3:in `'

Anyone knows how to fix this? It seems that when running a spec, the needed file textmate_rspec_last_remembered_file_cache.txt is not created. Maybe some permission problem?

:29:in `require': no such file to load -- spec/autorun (LoadError) ...

I get the following output when I try to run a spec with cmd+r.

:29:in require': no such file to load -- spec/autorun (LoadError) from :29:inrequire' from /Users/nibbo/Library/Application Support/TextMate/Bundles/Spec.tmbundle/Support/lib/spec/mate.rb:16:in ' from :29:inrequire' from :29:in require' from /tmp/textmate-command-38830.rb:2:in'

Rails3
Bundler
Rspec 2.0.0.beta.22

Just as if you need any more info

DEPRECATION WARNING

***************************************************************** DEPRECATION WARNING: you are using deprecated behaviour that will be removed from a future version of RSpec. /Users/fredrik/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/mate/runner.rb:38:in `block in run' * disable_autorun! is deprecated. *****************************************************************

Trickiness with RVM, TextMate, RSpec integration

Hi.

First, thanks for the RSpec tmbundle.

I found that in order to get the RSpec TextMate bundle running with RVM, I had to do several things. (None of which are necessarily faults of the rspec-tmbundle itself, but which documenting in one place might help improve)

  1. Follow the instructions here: http://beginrescueend.com/integration/textmate/. At a high level:

a. Create a textmate_ruby command, double checking that it follows the following suggestions:
1. http://groups.google.com/group/rubyversionmanager/browse_thread/thread/64b84bbcdf49e9b?fwc=1) that ensure that its invocation maintains local project .rvmrc configuration.
2. Also ensure that it uses #!/usr/bin/env bash instead of just sh.

b. Set up a TM_RUBY option in TextMate/Preferences/Advanced/Shell Variables that points to the textmate_ruby command.
2. Set up the RUBYOPT rubygem option per the existing RSpec tmbundle documentation. (In my case since I am not using bundler for the gem I am building)

Thanks.
Matt

Textmate 2 bundler support

Hi there,

I have the bundle installed and it seems to bypass my bundler Gemfile altogether:

Gem::LoadError: You have already activated rspec-core 2.13.1, but your Gemfile requires rspec-core 2.6.4. Using bundle exec may solve this.

I tried installing from the preferences window and by cloning the repo into ~/Library/Application Support/TextMate/Managed/Bundles, without luck.

Beware, this is happening in Textmate 2

Load Error (ruby 1.8.7).

Hi

When running spec with CMD-R, I get this error:

/Users/haim/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/mate.rb:31:in `require': no such file to load -- spec/autorun (LoadError) from /Users/haim/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/mate.rb:31 from /tmp/textmate-command-11109.rb:2:in `require' from /tmp/textmate-command-11109.rb:2

The load error was caused by the lack of "require 'rubygems'" which is required when working with ruby 1.8.7.

Thanks in advance

Haim

`require': no such file to load -- spec/autorun (LoadError)

I have the latest version of RSpec.tmbundle installed and it has problems finding spec when using Command R to run a test.

Gem Versions
gem list --local | grep spec
rspec (1.3.0)
rspec-rails (1.3.2)

Error

/Users/jspooner/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/rspec/mate.rb:43:in require': no such file to load -- spec/autorun (LoadError) from /Users/jspooner/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/rspec/mate.rb:43 from /tmp/textmate-command-32483.rb:2:inrequire' from /tmp/textmate-command-32483.rb:2

Giving an error for rspec/core in Rails 2.3.8/RSpec 1 app (not using bundler)

I have a fresh rvm gemset for the app, and when saving a _spec file or trying Cmd-R to run the individual spec, I get the following error:

/Users/xxxx/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/mate.rb:23:in `require': no such file to load -- rspec/core (LoadError) 
from /Users/xxxx/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/mate.rb:23 
from /tmp/textmate-command-56660.rb:2:in `require' 
from /tmp/textmate-command-56660.rb:2

This is a pretty fresh install of TextMate as well, as I've been reinstalling everything on a new laptop. After getting the


gem list:

actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activeresource (2.3.8)
activesupport (2.3.8, 2.3.5)
autotest (4.3.2)
autotest-fsevent (0.2.2)
autotest-growl (0.2.4)
autotest-rails (4.1.0)
builder (2.1.2)
cucumber (0.8.3)
cucumber-rails (0.3.2)
database_cleaner (0.5.2)
diff-lcs (1.1.2)
factory_girl (1.3.1)
ffaker (0.4.0)
gherkin (2.0.2)
json_pure (1.4.3)
mysql2 (0.1.8)
nokogiri (1.4.2)
rack (1.1.0)
rack-test (0.5.4)
rails (2.3.8)
rake (0.8.7)
rdoc (2.5.8)
redgreen (1.2.2)
rspec (1.3.0)
rspec-rails (1.3.2)
sqlite3-ruby (1.3.1)
sys-uname (0.8.4)
term-ansicolor (1.0.5)
trollop (1.16.2)
webrat (0.7.1)
will_paginate (2.3.14)
ZenTest (4.3.3)


ruby -v
ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-darwin10.3.1]

context or describe blocks without a block break the colouring

Just a dumb example to demonstrate:

describe "When I go to the login page" do
  before { visit login_path }

  context "I should see the header", :login => :failed

  context "some other context"

end

This is valid rspec code, however the second context block loses its orange color and becomes white.

I'd fix it if I was any good with Regex

No pending snippets

Great tmbundle. I just noticed recently that there are no snippets for pending tasks. I use these a lot, so would be happy to contribute a patch to add them, but wanted to check and see if a) I was just missing them somewhere or b) they were being purposely excluded, before I did so.

Problem running rspec from TM

It throws me an error:

/Users/dmilith/Library/Application Support/TextMate/Bundles/rspec.tmbundle/Support/lib/spec/mate.rb:23:in require': no such file to load -- rspec/core (LoadError) from /Users/dmilith/Library/Application Support/TextMate/Bundles/rspec.tmbundle/Support/lib/spec/mate.rb:23 from /tmp/textmate-command-35307.rb:2:inrequire' from /tmp/textmate-command-35307.rb:2

Remove support for RSpec 1?

I think supporting three different major version makes the everything quite complex, so I’d really appreciate if we could get rid of RSpec 1 support.

Is anyone still using this bundle with RSpec 1? (You know, back in the days when it was Spec instead of RSpec 😉 )

Replace “Save example file and remember” with real “Run Again” command?

@glennfu brought up this idea in #72 (comment):

“Save Example file and remember” looks unbound, but it’s one of the only features about RubyMine that I feel is really nice. I changed my local behavior to automatically save the file whenever I run a spec file or a focused spec, and then bound the “Run Last Examples file” to ctrl+cmd+r. I also changed the “scope selector” of the bundle command to *. With that, I have a “retry” button from any file for whatever the last spec was that I ran from any file. Super handy! I can keep coding and changing and retrying as I go without actually needing to go back to the spec file.

We did something very similar a while ago in our fork (die-antwort@30159e9):

New Keybindings: Cmd-Alt-R = "Run Again", Cmd-Shift-Alt-R = "Run Selected Files" (available in ALL scopes).

"Run Again" does a real rerun of the last run - whether it was a single context, a single file, or multiple files.

So it seems this would be quite a useful thing to have. What does everybody else think?

Release a new version!

The last release was in February, and many wonderful features have been added since then and they're very stable. What needs to be done to release a new version so that TextMate can automatically update this bundle for everyone?

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.