forked from jmccaffrey/RailRoad
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9702c4c
commit f272106
Showing
5 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') | ||
require 'controllers_diagram' | ||
require 'options_struct' | ||
|
||
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("spec/file_fixture/") | ||
files.size.should == 4 | ||
end | ||
|
||
it 'should exclude a specific file' do | ||
options = OptionsStruct.new(:exclude => ['spec/file_fixture/app/controllers/dummy1_controller.rb']) | ||
cd = ControllersDiagram.new(options) | ||
files = cd.get_files("spec/file_fixture/") | ||
files.size.should == 3 | ||
end | ||
|
||
it 'should exclude a glob pattern of files' do | ||
options = OptionsStruct.new(:exclude => ['spec/file_fixture/app/controllers/sub-dir/*.rb']) | ||
cd = ControllersDiagram.new(options) | ||
files = cd.get_files("spec/file_fixture/") | ||
files.size.should == 3 | ||
end | ||
|
||
it 'should include only specific file' do | ||
options = OptionsStruct.new(:specify => ['spec/file_fixture/app/controllers/sub-dir/sub_dummy_controller.rb']) | ||
cd = ControllersDiagram.new(options) | ||
files = cd.get_files("spec/file_fixture/") | ||
files.size.should == 1 | ||
end | ||
|
||
it 'should include only specified files' do | ||
options = OptionsStruct.new(:specify => ['spec/file_fixture/app/controllers/{dummy1_*.rb,sub-dir/sub_dummy_controller.rb}']) | ||
cd = ControllersDiagram.new(options) | ||
files = cd.get_files("spec/file_fixture/") | ||
files.size.should == 2 | ||
end | ||
|
||
it 'should include only specified files and exclude specified files' do | ||
options = OptionsStruct.new(:specify => ['spec/file_fixture/app/controllers/{dummy1_*.rb,sub-dir/sub_dummy_controller.rb}'], | ||
:exclude => ['spec/file_fixture/app/controllers/sub-dir/sub_dummy_controller.rb']) | ||
cd = ControllersDiagram.new(options) | ||
files = cd.get_files("spec/file_fixture/") | ||
files.size.should == 1 | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class ApplicationController < ActionController::Base | ||
end |
Empty file.
Empty file.
Empty file.