Skip to content

Commit

Permalink
Add test to yri to ensure serialization occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
lsegal committed May 30, 2012
1 parent 2d437ad commit 702534e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions spec/cli/yri_spec.rb
@@ -1,12 +1,14 @@
require File.dirname(__FILE__) + '/../spec_helper'

class YARD::CLI::YRI
class TestYRI < YARD::CLI::YRI
public :optparse, :find_object, :cache_object
def test_stub; end
def print_object(*args) test_stub; super end
end

describe YARD::CLI::YRI do
before do
@yri = YARD::CLI::YRI.new
@yri = TestYRI.new
Registry.stub!(:load)
end

Expand Down Expand Up @@ -85,5 +87,13 @@ class YARD::CLI::YRI
@yri.should_receive(:exit).with(1)
@yri.run('Foo')
end

it "should ensure output is serialized" do
obj = YARD::CodeObjects::ClassObject.new(:root, 'Foo')
class << @yri
def test_stub; @serializer.should_receive(:serialize).once end
end
@yri.run('Foo')
end
end
end

0 comments on commit 702534e

Please sign in to comment.