Sha256: 40d8731a115d2a24175ca953ac5ff0dbcff1c7821732988e8d88d73f394efbe8
Contents?: true
Size: 1.91 KB
Versions: 3
Compression:
Stored size: 1.91 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper') describe ControllersDiagram do describe 'file processing' do it 'should select all the files under the controllers dir' do cd = ControllersDiagram.new files = cd.get_files("test/file_fixture/") files.size.must_equal 4 end it 'should exclude a specific file' do options = OptionsStruct.new(:exclude => ['test/file_fixture/app/controllers/dummy1_controller.rb']) cd = ControllersDiagram.new(options) files = cd.get_files("test/file_fixture/") files.size.must_equal 3 end it 'should exclude a glob pattern of files' do options = OptionsStruct.new(:exclude => ['test/file_fixture/app/controllers/sub-dir/*.rb']) cd = ControllersDiagram.new(options) files = cd.get_files("test/file_fixture/") files.size.must_equal 3 end it 'should include only specific file' do options = OptionsStruct.new(:specify => ['test/file_fixture/app/controllers/sub-dir/sub_dummy_controller.rb']) cd = ControllersDiagram.new(options) files = cd.get_files("test/file_fixture/") files.size.must_equal 1 end it 'should include only specified files' do options = OptionsStruct.new(:specify => ['test/file_fixture/app/controllers/{dummy1_*.rb,sub-dir/sub_dummy_controller.rb}']) cd = ControllersDiagram.new(options) files = cd.get_files("test/file_fixture/") files.size.must_equal 2 end it 'should include only specified files and exclude specified files' do options = OptionsStruct.new(:specify => ['test/file_fixture/app/controllers/{dummy1_*.rb,sub-dir/sub_dummy_controller.rb}'], :exclude => ['test/file_fixture/app/controllers/sub-dir/sub_dummy_controller.rb']) cd = ControllersDiagram.new(options) files = cd.get_files("test/file_fixture/") files.size.must_equal 1 end end end
Version data entries
3 entries across 3 versions & 1 rubygems