Skip to content

Commit

Permalink
More helpful debugging info
Browse files Browse the repository at this point in the history
  • Loading branch information
Larry Diehl committed Aug 29, 2009
1 parent 05f5bd2 commit fb9cdc0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dataflow.rb
Expand Up @@ -53,7 +53,7 @@ def __unify__(value)
LOCK.synchronize do
__activate_trigger__ if @__trigger__
if @__bound__
raise UnificationError if self != value
raise UnificationError, "#{@__value__.inspect} != #{value.inspect}" if self != value
else
@__value__ = value
@__bound__ = true
Expand All @@ -73,7 +73,7 @@ def __activate_trigger__
def method_missing(name, *args, &block)
LOCK.synchronize do
unless @__bound__
return '#<Dataflow::Variable unbound>' if name == :inspect
return "#<Dataflow::Variable:#{__id__} unbound>" if name == :inspect
if @__trigger__
__activate_trigger__
else
Expand Down
2 changes: 1 addition & 1 deletion spec/inspect_spec.rb
Expand Up @@ -3,7 +3,7 @@
describe "An unbound variable" do
it "should be inspectable for debugging purposes" do
local do |unbound|
unbound.inspect.should == "#<Dataflow::Variable unbound>"
unbound.inspect.should =~ /#<Dataflow::Variable:[0-9]+ unbound>/
end
end
end
Expand Down

0 comments on commit fb9cdc0

Please sign in to comment.