Sha256: d264379ed9c53c75888cc3eff3f520e5ae6d04c6d833f865792c507872250d4b

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")

module Polonium
describe TestCase, "Class methods" do
  include SeleniumTestCaseSpec
  it "should maintain a subclass array" do
    test_class = Class.new
    test_class.extend Polonium::TestCase::ClassMethods

    subclass1 = Class.new(test_class)
    subclass2 = Class.new(test_class)

    test_class.subclasses.should ==  [subclass1, subclass2]
  end

  it "should not use transactional fixtures by default" do
    Polonium::TestCase.use_transactional_fixtures.should ==  false
  end

  it "should use instantiated fixtures by default" do
    Polonium::TestCase.use_instantiated_fixtures.should ==  true
  end

  class Parent < Polonium::TestCase
  end
  class Child1 < Parent
  end
  class Child2 < Parent
  end
  class Grandchild1 < Child1
  end
  class Grandchild2 < Child2
  end
  class Grandchild3 < Child2
  end

  it "should recursively gather all subclasses" do
    Parent.all_descendant_classes.should == ([Child1, Grandchild1, Child2, Grandchild2, Grandchild3])
  end
end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polonium-0.1.0 spec/polonium/selenium_test_case_class_method_spec.rb