Comments (5)
Preliminary guess: RSpec and SeeingIsBelieving are fighting over at_exit hooks. I'll look into it more over the weekend.
from seeing_is_believing.
Also, it looks like your version is old (I should totally include the version info in that output >.<) because SIB serializes with YAML
since version 0.0.23, but yours looks like Marshal
from seeing_is_believing.
NVM, I just reproduced it >.<
from seeing_is_believing.
Okay, it doesn't blow up in the version that's about to be released, which you can get early if you want, it's on the switching_to_parser branch. I'll add a regression test for it, too.
from seeing_is_believing.
Well, this is what I get for going through this at 2AM while sauced, I had version 0.0.22 installed on the version of Ruby I was looking at. It is actually fixed in the currently released 1.0.0. It had to do with invoking a method that was not defined. Ruby raises a NameError
, but it's message is not actually an instance of String
, it's an instance of NameError::message
which is not a valid class name, and can't be allocated (instead of calling .new
on it, you call .!
(I shit you not)) and thus was unable to deserialize it. I've had a workaround for that for a while now (basically serializing backtraces and messages independently of the exceptions).
Here is an example of what was happening.
require 'yaml'
# get a NameError with a message that isn't a String
exception = nil
begin
abc
rescue
exception = $! # => #<NameError: undefined local variable or method `abc' for main:Object>
end
# get the message class (b/c its name is invalid, can't just do `NameError::message` or even `NameError.const_get :message`)
message_class = nil
ObjectSpace.each_object(Class) { |c| message_class = c if c.name == 'NameError::message' }
message_class # => NameError::message
# show that you can't instantiate it with .new, (because it delegates to .allocate, which is undefined... good troll, Ruby, good troll)
begin
message_class.new
rescue
$! # => #<TypeError: allocator undefined for NameError::message>
end
# so how do we instantiate this thing? with `.!`, of course, lol
new_message = message_class.! 'o', 'm', 'g' # => #<NameError::message:0x007f836b07eae0>
new_message.to_str # => "o"
# show that the instance of this class is our message
message = nil
ObjectSpace.each_object(message_class) { |m| message = m }
message
message.to_str
exception.message # => "undefined local variable or method `abc' for main:Object"
# an example showing we can't serialize the exception because of this message class
YAML.load YAML.dump exception # ~> TypeError: allocator undefined for NameError::message
# ~> TypeError
# ~> allocator undefined for NameError::message
# ~>
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:303:in `allocate'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:303:in `revive'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:178:in `visit_Psych_Nodes_Mapping'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/visitor.rb:15:in `visit'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/visitor.rb:5:in `accept'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:20:in `accept'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:210:in `block in visit_Psych_Nodes_Mapping'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:210:in `map'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:210:in `visit_Psych_Nodes_Mapping'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/visitor.rb:15:in `visit'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/visitor.rb:5:in `accept'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:20:in `accept'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:240:in `visit_Psych_Nodes_Document'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/visitor.rb:15:in `visit'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/visitor.rb:5:in `accept'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/visitors/to_ruby.rb:20:in `accept'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych/nodes/node.rb:35:in `to_ruby'
# ~> /Users/joshcheek/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/psych.rb:130:in `load'
# ~> /var/folders/80/_k3gdsls7vs760m_8v6h651w0000gn/T/seeing_is_believing_temp_dir20130809-69619-1h6c2i0/program.rb:40:in `<main>'
from seeing_is_believing.
Related Issues (20)
- Multiple inspects HOT 1
- Printing tabs replaces the output with "\t"
- Output is horrible when run against a moved file
- Thoughts after reading the help screen
- Uuhhhmm, add an in-place update flag
- Remove custom String#pp
- Should handle missing constants
- cross-invocation state HOT 1
- Outdated parser runtime dependency generates deprecation warning in Ruby 2.7 HOT 6
- VSCode Description isn't complete HOT 1
- Feature request: line which updates obviously to confirm file was reevaluated
- Endless method support
- Let errors in inspect raise
- Getting WARN -- : posix_spawn is not yet supported on x86_64-cygwin (x86_64-cygwin), falling back to default implementation. HOT 4
- Relaxing the FFI dependency version constraint HOT 9
- Ruby3 endless method bug
- Something funky with frozen string literals
- segfault *sigh*
- in `find_type': unable to resolve type 'intptr_t' (TypeError) HOT 3
- New release to support Apple Silicon (M1) Macs? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seeing_is_believing.