Sha256: c5008dc86b41af70e2d61d5edadcf93ee06721e5f7959cecfe27064a39cffaf6

Contents?: true

Size: 1.36 KB

Versions: 1

Compression:

Stored size: 1.36 KB

Contents

require "test/helper"

module TestBelt::ShouldaMacros
  class FilesTest < Test::Unit::TestCase

    context "TestBelt Shoulda Macros for files" do

      # should require a root path
      setup do
        @root_path = File.expand_path(File.dirname(__FILE__))
      end

      # should provide these macros
      should "provide a set of macros" do
        assert self.class.respond_to?(:should_have_directories), "no :should_have_directories macro"
        assert self.class.respond_to?(:should_have_directory), "no :should_have_directory macro"
        assert self.class.respond_to?(:should_have_files), "no :should_have_files macro"
        assert self.class.respond_to?(:should_have_file), "no :should_have_file macro"

        assert self.class.respond_to?(:skip_should_have_directories), "no :should_have_directories macro"
        assert self.class.respond_to?(:skip_should_have_directory), "no :should_have_directory macro"
        assert self.class.respond_to?(:skip_should_have_files), "no :should_have_files macro"
        assert self.class.respond_to?(:skip_should_have_file), "no :should_have_file macro"
      end

      # should find the @root_path directory
      should_have_directories
      skip_should_have_directories

      #should find files in the @root_path directory
      should_have_files 'files_test.rb'
      skip_should_have_files 'files_test.rb'
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
test-belt-0.2.1 test/shoulda_macros/files_test.rb