test/pelusa/class_analyzer_test.rb in pelusa-0.2.2 vs test/pelusa/class_analyzer_test.rb in pelusa-0.2.3
- old
+ new
@@ -19,8 +19,22 @@
describe '#class_name' do
it 'returns the name of the analyzed class' do
@analyzer.class_name.must_equal "Foo"
end
end
+
+ describe "#type" do
+ it "returns the type module for modules" do
+ # hacky!
+ @klass.stubs(:is_a?).with(Rubinius::AST::Class).returns(true)
+ @analyzer.type.must_equal "class"
+ end
+
+ it "returns the type module for modules" do
+ # hacky!
+ @klass.stubs(:is_a?).with(Rubinius::AST::Class).returns(false)
+ @analyzer.type.must_equal "module"
+ end
+ end
end
end
end