CARVIEW |
rspec / rspec-core
- Source
- Commits
- Network (43)
- Issues (16)
- Wiki (1)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
-
bug2.0
Comments
-
rspec-1 compat2.0
Comments
dchelimsky Mon Jul 26 21:21:19 -0700 2010 | linkStarted work on this. Introduced a Reporter which delegates to n formatters. It also keeps track of all the counts, so formatters don't have to.
-
rspec-1 compat2.0bug
-
feature request
This was suggested for cucumber, and it would also be nice for RSpec as well.
Here's the cuke discussion
https://groups.google.com/group/cukes/browse_thread/thread/acf19d76cfdbfdb7It would be nice if the option names were coordinated, which is why I'm not submiting this a s patch.
Comments
Please log in to comment. -
feature request
While writing code I just got this failure:
1) Rspec::Core::Runner ::DRbProxy with server running integrates via #run Failure/Error: Rspec::Core::Runner.new.run(%W[ --drb --drb-port #{drb_port} --version ], @err, @out) private method `puts' called for nil:NilClass # /Users/ashleymoran/Dropbox/PatchSpace/Development/work-source/rspec/rspec-core/spec/rspec/core/runner_spec.rb:180:in `block (4 levels) in <top (required)>'
Which is not enough to isolate the problem directly. Using -b on the command line gives me what I need, but too much. What would be ideal is to have the spec line that caused the failure, and also the topmost library code line too. In this case it would be:
1) Rspec::Core::Runner ::DRbProxy with server running integrates via #run Failure/Error: Rspec::Core::Runner.new.run(%W[ --drb --drb-port #{drb_port} --version ], @err, @out) private method `puts' called for nil:NilClass # /Users/ashleymoran/Dropbox/PatchSpace/Development/work-source/rspec/rspec-core/lib/rspec/core/runner.rb:104:in `run' # /Users/ashleymoran/Dropbox/PatchSpace/Development/work-source/rspec/rspec-core/spec/rspec/core/runner_spec.rb:180:in `block (4 levels) in <top (required)>'
(Merb handles this really well in its error pages, and lets you configure where you see errors from - lib, gems, framework. I'm sure you could go to town with error reporting, but just the above change would be really useful, to me at least.)
Comments
Don't forget you can do:
it "raises an error", :full_backtrace => true do ....
ashleymoran Mon Jul 26 00:05:35 -0700 2010 | linkThanks justinko, didn't know about that!
-
feature request
Comments
dchelimsky Mon Jun 14 06:14:55 -0700 2010 | linkrspec-2 filtering is quite flexible, but you have to type things into an
RSpec.configure
block to use them. It would be nice to access them directly from the command line, and make it similar to the API for cucumber (from the command line, not internally).Possibilities include:
- explicit hash key
describe "something" do it "does something", :tags => [:foo, :bar] do ...
This would run with either of these (supporting the @ prefix to ease confusion when switching between rspec and cucumber commands):
$ rspec spec -t foo $ rspec spec -t bar $ rspec spec -t @foo $ rspec spec -t @bar
- keys and/or key/value pairs
describe "something" do it "does something", :focus => true do ... it "does something slow", :slow => true do $ rspec spec -t focus # runs the first one $ rspec spec -t focus:true # runs the first one $ rspec spec -t ~@slow # runs all but the second one $ rspec spec -t ~@slow:true # runs all but the second one
- profiles
RSpec.configure do |c| c.profile :wip => "--tags @wip" end describe "something" do it "does something", :wip => true do ... $ rspec spec --profile wip
I'm interested in hearing thoughts about these ideas and any new ideas as well.
I like the explicit hash key (:tags => [:foo, :bar]) as it maps most closely to what people are already used to from Cucumber.
The second idea seems a little more complex to me, and I don't see what the extra complexity buys us.
The idea of using "~" on the command line to negate the selection would work for the explicit hash key variant as well:
$ rspec spec -t ~@foo
Not sure if there are any shells out there though that treat "~" as a glob-like special character and automatically expand it before passing it off to the rspec process. Might be worth checking that out...
What about making the bag of parameters that's passed to the #it or #describe block be able to be either an array (of symbols) or a hash, or a mixture of both.
That way the keys can be treated as tags implicitly, but you can also give value to tags (something cucumber doesn't let you do).
e.g.
describe "something" do it "does something", :focus, :ruby => 1.9 do ...
This is nice and terse - IMO the => true or :tags => bit is just noise really.
Or would that conflict with other existing behaviour for these arguments?
Another thought is that you can use the '@' character in the tags when defining them in the describe blocks, I think that might make things easier to understand. You could either use strings or symbols I reckon:
:@focus, '@ruby' => 1.9
Dunno, maybe that doesn't look so nice. At least it's obvious they're tags though.
dchelimsky Tue Jun 15 03:50:53 -0700 2010 | link@wincent - the reason to support the key/val pair is because it's the same structure we use in RSpec.configure for filtering:
RSpec.configure do |c| c.filter_run :focus => true end
This way we'd use the same markup (for lack of a better term) in the spec files and be able to access it from the config block or the command line.
The ~@tagname format is what cucumber uses, which is the main reason to support it. If a shell doesn't allow for that it wouldn't allow it for cucumber either. Not that that makes it good, but it does make it consistent across the two :)
@mattwynne - rspec-1 supports arbitrary # of args, but that dates back to pre-nesting days so you could say
describe SomeClass, "#some_method"
. I'd be a bit nervous to change the way that works now (one more point of confusion in the upgrade process), but it's not out of the question.Not sure that :@focus is obvious as a tag to anyone other than cucumber users :)
Thanks to you both for the feedback. Any others?
-
bug
When including module within ExampleGroup then constants from that module should be accessible directly without specifying module name:
module MyModule MyConstant = 1 def my_method 2 end end describe "including modules" do include MyModule it "works" do my_method.should == 2 MyModule::MyConstant.should == 1 end it "doesn't work, but should" do MyConstant.should == 1 end end
Running this simple spec will produce one failure with this message:
1) NameError in 'including modules doesn't work' uninitialized constant MyConstant
But in regular Ruby everything works as expected:
class MyClass include MyModule def initialize p my_method p MyModule::MyConstant p MyConstant end end MyClass.new # produces 2 1 1
Comments
dchelimsky Wed Jun 16 07:48:49 -0700 2010 | linkRuby version?
ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32]
rspec version is 1.3.0The problem also exists with:
ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]But everything is working with:
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]So it seems that this problem exists only with Ruby 1.8
i think that this is the problem I had when I updated to beta13. It does not happen in beta12
dchelimsky Mon Jun 28 15:49:47 -0700 2010 | linkIs this fixed with beta 14?
-
feature request
Here is an example backtrace gotten from running an entire spec suite that uses shared spec groups
8) RuntimeError in 'Arel Join#each iterates over the rows in any order' /Users/apatterson/git/arel/spec/../lib/arel/algebra/relations/operations/join.rb:14:in `hash' /Users/apatterson/git/arel/spec/../lib/arel/session.rb:38:in `[]' /Users/apatterson/git/arel/spec/../lib/arel/session.rb:38:in `read' /Users/apatterson/git/arel/spec/../lib/arel/algebra/relations/relation.rb:21:in `each' /Users/apatterson/git/arel/spec/support/matchers/have_rows.rb:5:in `have_rows' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/matchers/simple_matcher.rb:16:in `call' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/matchers/simple_matcher.rb:16:in `matches?' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/expectations/handler.rb:11:in `handle_matcher' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/expectations/extensions/kernel.rb:27:in `should' /Users/apatterson/git/arel/spec/shared/relation_spec.rb:23: /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/example/example_methods.rb:40:in `instance_eval' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/example/example_methods.rb:40:in `execute' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:53:in `timeout' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/example/example_methods.rb:37:in `execute' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/example/example_group_methods.rb:214:in `run_examples' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/example/example_group_methods.rb:212:in `each' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/example/example_group_methods.rb:212:in `run_examples' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/example/example_group_methods.rb:103:in `run' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:23:in `run' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:22:in `each' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:22:in `run' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/runner/options.rb:152:in `run_examples' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/lib/spec/runner/command_line.rb:9:in `run' /Library/Ruby/Gems/1.8/gems/rspec-1.3.0/bin/spec:5
There are a few problems here.
1) given the backtrace, I have no idea what the context of the shared spec is. Aka, where was it included, what file was it included in, etc... There is the description 'Arel Join#each iterates over the rows in any order', but in a project with a lot of specs, that's basically useless to me.
2) I would like a way to run that single spec in isolation in the context that caused it to fail. I'm not sure of how to do that right now.
Comments
David, I think I might have a solution for this:
When "it_should_behave_like" (or the alias) is called, it sets the following metadata on the ExampleGroup:
Name of the shared example group.
File path and line number of "it_should_behave_like" method call.When an example fails, RSpec will check to see if that example exists in the shared example group. If it does, it will append to the output the file path and line number (stored in the ExampleGroup metadata).
What do you think?
-
I'm going to use rspec-rails examples to illustrate this, but I am posting this against rspec-core because I think it's an issue at the core level.
I've noticed a discrepancy between using
:type
to include a module in an example group:RSpec.configure do |config| config.include AmazingHelpers, :type => :controller end
And using
:example_group
and:file_path
:RSpec.configure do |config| config.include AmazingHelpers, :example_group => { :file_path => %r{\b/spec/controllers} } end
I would have expected these to behave identically, seeing as the
:type
metadata is set on the basis of file paths (usinginclude_self_when_dir_matches
). But I discovered a discrepancy on a large project where some of the specs are written using nested style (ie. what I consider to be the "current" recommended style):describe Thing do it 'does something' do ... end describe 'aspect 1' do ... end describe 'aspect 2', do ... end end
And some of the specs are written without nesting (ie. dating back to when RSpec didn't support nesting, or nesting was a very new thing):
describe Thing do it 'does something' do ... end end describe Thing, 'aspect 1' do ... end describe Thing, 'aspect 2' do ... end
The discrepancy lies in the following:
- when using
:type
to include the module, it is only included in all "new style" nested blocks, but in the "old style" non-nested blocks it is only included in the first block in the file, not the other blocks of the formThing, 'aspect ...'
. - when using
:example_group
and:file_path
to include the module, it is included in all blocks, both "new style" and "old style"
No idea if this discrepancy is a bug in RSpec, but wanted to make note of it here anyway, just in case.
In any case, I am going to make a sweep over the application and re-organize the example groups using the "new" nested style (the thing is the app is a three-year-old code base, so it has quite a lot of "old" stuff in the specs). I gather that the pattern of passing multiple params to
describe
likeThing, 'aspect ..'
probably only works by accident in RSpec 2 anyway.Cheers,
WincentComments
Please log in to comment. - when using
-
rspec-2 seems to work w/ jruby, but there is some sort of load path problem running rspec-core-2's cukes against jruby (using rvm):
$ ruby -S cucumber features/command_line/example_name_option.feature:44 Using the default profile... ... expected: /1\ example,\ 0\ failures/, got: "\n----------------------------------------------------------------------\n/Users/dchelimsky/projects/rspec2/repos/rspec-core/lib/rspec/core.rb:46:in `require': no such file to load -- rspec/expectations (LoadError)\n\tfrom /Users/dchelimsky/projects/rspec2/repos/rspec-core/lib/rspec/core.rb:46\n\tfrom /Users/dchelimsky/projects/rspec2/repos/rspec-core/lib/rspec/core.rb:1:in `require'\n\tfrom /Users/dchelimsky/projects/rspec2/repos/rspec-core/lib/rspec/autorun.rb:1\n\tfrom /Users/dchelimsky/projects/rspec2/repos/rspec-core/lib/rspec/autorun.rb:2:in `require'\n\tfrom /Users/dchelimsky/projects/rspec2/repos/rspec-core/tmp/aruba/../../bin/rspec:2\n" (using =~) (Rspec::Expectations::ExpectationNotMetError) features/command_line/example_name_option.feature:46:in `Then I should see "1 example, 0 failures"'
Comments
-
It would be very nice if error output would show the class of the exception thrown. That would help a lot in tracing bugs.
Comments
dchelimsky Sat Jul 24 23:27:22 -0700 2010 | linkI can see showing the classname, but value do you get from the failure/error distinction?
The failure/error distinction comes a bit out of the first. I was figuring that you don't want to show ExpectationNotMetError, because it's obvious in it's description, you just want to provide the clean message like we're seeing now.
I'd think it would give a bit cleaner output, that's all. It's just nice to have.
dchelimsky Sun Jul 25 07:09:50 -0700 2010 | linkWould you please post a separate issue for the E/F distinction. Though related, these are two separate requests.
-
feature request
-
1.xneed info
I'm getting loads of failed specs when running under Ruby 1.9.2-rc2. They run successfully with 1.9.1 and 1.8.7. It seems like rspec doesn't understand implicit subjects in the specs. Here is an example:
describe Activity do it { should respond_to(:name) } # more stuff like this end
When running the spec, I get:
wrong number of arguments (1 for 0)
I'm using rspec 1.3.0.
Comments
dchelimsky Tue Jul 20 08:02:34 -0700 2010 | linkPlease post the initialize method in Activity and the full backtrace.
Thx
I'll work on getting that to you. Activity is an ActiveRecord model (Rails.)
I did find this patch https://gist.github.com/401267 and applying it fixes MOST, but not all of the failed specs.
Here is the full backtrace from a failed spec:
ArgumentError in 'Activity ' wrong number of arguments (1 for 0) /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/subject.rb:43:in `block in implicit_subject' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/subject.rb:77:in `instance_eval' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/subject.rb:77:in `subject' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/subject.rb:91:in `should' spec/models/activity_spec.rb:18:in `block (2 levels) in <top (required)>' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/example_methods.rb:40:in `instance_eval' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/example_methods.rb:40:in `block in execute' /Users/pete/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/timeout.rb:44:in `timeout' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/example_methods.rb:37:in `execute' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/example_group_methods.rb:214:in `block in run_examples' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/example_group_methods.rb:212:in `each' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/example_group_methods.rb:212:in `run_examples' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/example_group_methods.rb:103:in `run' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:23:in `block in run' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:22:in `each' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:22:in `run' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/runner/options.rb:152:in `run_examples' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/runner/command_line.rb:9:in `run' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/bin/spec:5:in `<top (required)>' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/bin/spec:19:in `load' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/bin/spec:19:in `<main>'
I'm also getting this at the top of the output:
No description supplied for example declared on spec/models/activity_spec.rb:18:in `block in <top (required)>'
A similar error occurs in pending specs, such as:
it "should do something"
The backtrace in this case is:
ArgumentError in 'Activity should do something' wrong number of arguments (1 for 0) /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/example_group_methods.rb:80:in `block in pending_implementation' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/example_methods.rb:40:in `instance_eval' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/example_methods.rb:40:in `block in execute' /Users/pete/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/timeout.rb:44:in `timeout' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/example_methods.rb:37:in `execute' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/example_group_methods.rb:214:in `block in run_examples' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/example_group_methods.rb:212:in `each' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/example_group_methods.rb:212:in `run_examples' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/example/example_group_methods.rb:103:in `run' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:23:in `block in run' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:22:in `each' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:22:in `run' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/runner/options.rb:152:in `run_examples' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/lib/spec/runner/command_line.rb:9:in `run' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/gems/rspec-1.3.0/bin/spec:5:in `<top (required)>' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/bin/spec:19:in `load' /Users/pete/.rvm/gems/ruby-1.9.2-rc2/bin/spec:19:in `<main>'
This is similar to the issue pointed out at https://rspec.lighthouseapp.com/projects/5645/tickets/971
I'm not sure if this is related, but I'm seeing
Failure/Error: its(:legacy_password) { should be_nil } implicit argument passing of super from method defined by define_method() is not supported. Specify all arguments explicitly.
-
bug2.0cannot reproduceneed info
When autotest picks up failures it sets itself to tainted and will keep rerunning the broken tests until they're fixed. This isn't working for me
I think the regex at autotest/rspec2.rb is to blame:
self.failed_results_re = /^\d+\)\n(?:\e\[\d*m)?(?:.*?in )?'([^\n]*)'(?: FAILED)?(?:\e\[\d*m)?\n\n?(.*?(\n\n\(.*?)?)\n\n/m
This doesn't match my output correctly. My current output looks like this:
1) Indicators::WeeklyChannel Failure/Error: specify { data.first.should respond_to(:weekly_channel)} expected #<ActiveBar:0x0000010111c270 @date=2010-07-02 00:00:00 UTC, @open="0", @high="1", @low="0", @close="/"> to respond to :weekly_channel # ./spec/indicators/weekly_channel_spec.rb:21:in `block (2 levels) in <top (required)>' Finished in 0.30017 seconds 14 examples, 1 failure
Comments
dchelimsky Thu Jul 29 04:38:45 -0700 2010 | linkI'm unable to reproduce this problem. What versions of ruby and rspec are you running, and what OS?
snappycode Sun Aug 01 23:41:48 -0700 2010 | linkruby 1.9.2dev (2009-07-18 trunk 24186) [i386-darwin10.4.0]
rspec 2.0.0.beta.16The regex is looking for FAILED whereas my output says Failure
snappycode Mon Aug 02 21:50:38 -0700 2010 | linkThis commit fixes it for the base text formatter. Instead of copying output text into the spec (which I think was outdated) it gets the text from the formatter itself
https://github.com/snappycode/rspec-core/commit/9344bcff9c658cc5b5cda78c85e8953644009463 -
TextMate Formatting dropping stack trace lines
0 comments Created 8 days ago by alexcrichtonThe textmate formatter looks like it's dropping some lines from the stack traces. Namely those that don't end in 'rb'.
I've run into this problem with erb templates and they're always gone from the stack trace. I'm guessing that haml files would also disappear as well.
I was able to fix it by changing the method in the textmate formatter class to
if line = super(line) line.sub!(/([^:]*\.e?rb):(\d*)/) do # same replacement as before... end line end
This way the files weren't dropped from the stack trace if they weren't recognized, they're just not links any more. It could also be extended to recognize haml files and all that fancy stuff as well, but I'm not sure how into that you wanna go...
Comments
Please log in to comment. -
bug
On rspec 2.0.0.beta.19 running the entire spec suite with "rake" seems to add an extra line to the backtrace in errors that appears to be unrelated:
1) bundle install with git sources switching sources doesn't explode when switching Path to Git sources
Failure/Error: should_be_installed "foo 1.0", "bar 1.0" expected: #<Gem::Version "1.0">, got: #<Gem::Version ""> (using ==) Diff: @@ -1,2 +1,2 @@ -Gem::Version.new("1.0") +Gem::Version.new("") # ./spec/support/matchers.rb:38:in `should_be_installed' # ./spec/support/matchers.rb:33:in `each' # ./spec/support/matchers.rb:33:in `should_be_installed' # ./spec/install/git_spec.rb:453 # ./spec/cache/gems_spec.rb:3
the bottom line doesn't seem to belong.
Comments
Please log in to comment.
- 1.x▾
- 2.0▾
- 2.1▾
- bug▾
- cannot reproduce▾
- duplicate▾
- feature request▾
- in progress▾
- invalid▾
- miraculously fixed▾
- moved▾
- need info▾
- needs specs▾
- optimization▾
- patch▾
- rspec-1 compat▾
- ruby 1.9▾
- windows▾
- wontfix▾
- Apply to Selection
-
Change Color…
Previewpreview
- Rename…
- Delete




Added @wip scenario to expose this: https://github.com/rspec/rspec-core/commit/234d7632c71c39d1a31429a6483200812395b877
Added pending example as well: https://github.com/rspec/rspec-core/commit/b78129b34ae5f99b7873bc67667808b4e332b786
This applies to after(:all) as well - maybe these shouldn't be treated the same as failures, but should have their own messaging other than bubbling up an error? Or maybe bubbling up an error in before/after(:all) is perfectly fine feedback.
Giving this some more thought, I think an error in before/after all is perfectly fine feedback. If anybody is paying attention and thinks otherwise, make your case a comment in this issue, please.
david, to answer your questions from the issue logged in rspec-rails[1].
I don't see the error being swallowed when running spec (or rspec) directly
either: truncating that part of the output when I opened the issue was sloppy on
my part.
However, the stack trace can be swallowed (and I think I have seen it swallowed
by autotest) because it prints to STDERR but the other output prints to STDOUT.
The problem is that the STDOUT output that lists the numbers of examples and
failures is exactly the same as in success, and indeed is even green when rspec
is run with -c.
Treating all examples in the group as failing seems like the right thing to do.
Personally I think not being able to set up an example counts as a failure, but
I can understand a view that says it's a different kind of error condition.
BTW I updated to 2.0.0.beta.15 and get the same behaviour (which is of course,
not surprising).
[1] https://github.com/rspec/rspec-rails/issues/issue/110
I am either not able to figure out how, or simply don't have permission to,
reopen this issue, but in case it's not clear from my previous comment, I
consider this still an issue, at least in version 2.0.0.beta.15.
Again (sorry for being repetitive) the stack trace is printed to stderr, this is
fine. But what is printed to stdout is in green and strongly implies that
the examples pass, when they in fact do not. Worse, if stderr is swallowed for
whatever reason, the output will appear exactly as if the examples all pass.
On a (semi-)related note, thanks for rspec. It is much appreciated :-)
I confirm on this one.
I think considering whole group a failure is a good idea.
Does this relate to the fact that if you use this in an example group:
You get this error?
This is really inconvenient, as I do this all the time to selectively put examples in the background to deal with later :-(
@ashleymoran - unrelated.
FYI - to make a group pending, just say so at the group level:
That makes all of the examples in the group pending.
HTH,
David
off-topic: wow, another trick I never knew.
Thanks - I didn't know that. Just checked and it works fine.
Is
pending
inbefore
blocks deprecated, or is that still a bug? The error message is not very helpful, and looks like it's unanticipated behaviour.@markiz - I like these! Using
focus: true
with the appropriate RSpec config is really useful too, in case you've not seen it (on David's blog).@ashleymoran - deprecated suggests it was supported before :) Please open a separate issue and we can discuss there.
Ha :) I've opened #77 to discuss
pending
inbefore
.is this bug the same as:
=>
I've been slamming my head against this as well.
When using the textmate bundle everything shows in html mode. And of course the formatter doesn't work with real exceptions, so I'm left seeing useless message:
Exception encountered: # backtrace: /Users/kevin/.rvm/gems/ree-1.8.7-2010.02/gems/dm-validations-1.0.0/lib/dm-validations.rb:141:in
name' /Users/kevin/.rvm/gems/ree-1.8.7-2010.02/gems/dm-validations-1.0.0/lib/dm-validations.rb:141:in
send' /Users/kevin/.rvm/gems/ree-1.8.7-The exception message doesn't escape the < and > so its not even shown and the backtrace with no newlines is painful.
It'd be nice if it was at least rendered nicely as a part of the formatter.
Alternatively, perhaps there should be an implicit first test that any before(:all) blocks don't raise an exception.
I think this is the same issue (or please correct me - if
let
is a different beast I'll move this). Anything in a class definition causes RSpec to blow up spectacularly:You don't get a runner output, just the following:
@ashleymoran - seems unrelated. Separate issue please, and please include the def for Representation.
I haven't written that yet :) Will file when I've got the code working...
@ashleymoran - aha! So your issue is that the error is not being captured, yes? If so, then it's the same issue :)
Yep - that's the one! Did I just save myself a ticket? =)
FYI - I'm keen to get this resolved before a release candidate of rspec-2. I've just been very busy wrapping up The RSpec Book and this issue relates to some deeper architectural questions so I don't want to just hack together a fix.
@ashleymoran - your self and everyone else's selves.
Cool cool. I agree, if it's a fundamental design issue, it's definitely one that needs resolving properly before an RC. I always assume (being used to RSpec 1.3) that if the output doesn't get formatted that I've made a syntax, so it puts my brain in the wrong type of bug-hunting mode. Lemme know if you want me test anything.