Sha256: 49277df66380a3301fa66f0f5425beec97948e78baafe66d6bd7c9dfa75e83ad
Contents?: true
Size: 917 Bytes
Versions: 2
Compression:
Stored size: 917 Bytes
Contents
require 'test/unit' require 'rspec' $: << 'examples/' class RSpecTest < Test::Unit::TestCase def test_should_load_craps_spec rspec = RSpec.new(["examples/craps_spec.rb"]) assert_equal true, get_classes.include?('CrapsSpecification') end def test_should_load_movie_spec rspec = RSpec.new(["examples/movie_spec.rb"]) assert_equal true, get_classes.include?('EmptyMovieList') assert_equal true, get_classes.include?('OneMovieList') end def test_should_load_craps_and_movie_specs rspec = RSpec.new(["examples/craps_spec.rb", "examples/movie_spec.rb"]) assert_equal true, get_classes.include?('CrapsSpecification') assert_equal true, get_classes.include?('EmptyMovieList') assert_equal true, get_classes.include?('OneMovieList') end private def get_classes classes = [] ObjectSpace.each_object(Class) {|cls| classes << cls.to_s} classes end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rspec-0.1.6 | test/rspec_test.rb |
rspec-0.1.5 | test/rspec_test.rb |