From 7a734376c4a5f94f8cb33924806cfa6017f65157 Mon Sep 17 00:00:00 2001 From: Scott Barron Date: Thu, 21 Feb 2008 12:18:08 -0500 Subject: [PATCH] Reorg spec dir to have units and functionals --- Rakefile | 4 ++-- spec/spec_helper.rb | 2 ++ spec/{ => unit}/aasm_spec.rb | 3 +-- spec/{ => unit}/event_spec.rb | 2 +- spec/{ => unit}/state_spec.rb | 2 +- spec/{ => unit}/state_transition_spec.rb | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 spec/spec_helper.rb rename spec/{ => unit}/aasm_spec.rb (94%) rename spec/{ => unit}/event_spec.rb (95%) rename spec/{ => unit}/state_spec.rb (96%) rename spec/{ => unit}/state_transition_spec.rb (96%) diff --git a/Rakefile b/Rakefile index 5720821..d946c48 100644 --- a/Rakefile +++ b/Rakefile @@ -66,14 +66,14 @@ if !defined?(Spec) else desc "Run all examples with RCov" Spec::Rake::SpecTask.new('cruise') do |t| - t.spec_files = FileList['spec/*.rb'] + t.spec_files = FileList['spec/**/*.rb'] t.rcov = true t.rcov_opts = ['--exclude', 'spec'] end desc "Run all examples" Spec::Rake::SpecTask.new('spec') do |t| - t.spec_files = FileList['spec/*.rb'] + t.spec_files = FileList['spec/**/*.rb'] t.rcov = false t.spec_opts = ['-cfs'] end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..46c310c --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,2 @@ +require File.join(File.dirname(__FILE__), '..', 'lib', 'aasm') +require File.join(File.dirname(__FILE__), '..', 'lib', 'state') diff --git a/spec/aasm_spec.rb b/spec/unit/aasm_spec.rb similarity index 94% rename from spec/aasm_spec.rb rename to spec/unit/aasm_spec.rb index 9a09ff7..17f4118 100644 --- a/spec/aasm_spec.rb +++ b/spec/unit/aasm_spec.rb @@ -1,5 +1,4 @@ -require File.join(File.dirname(__FILE__), '..', 'lib', 'aasm') -require File.join(File.dirname(__FILE__), '..', 'lib', 'state') +require File.join(File.dirname(__FILE__), '..', 'spec_helper') class Foo include AASM diff --git a/spec/event_spec.rb b/spec/unit/event_spec.rb similarity index 95% rename from spec/event_spec.rb rename to spec/unit/event_spec.rb index 0b0ce89..623a3ae 100644 --- a/spec/event_spec.rb +++ b/spec/unit/event_spec.rb @@ -1,4 +1,4 @@ -require File.join(File.dirname(__FILE__), '..', 'lib', 'event') +require File.join(File.dirname(__FILE__), '..', 'spec_helper') describe AASM::SupportingClasses::Event do before(:each) do diff --git a/spec/state_spec.rb b/spec/unit/state_spec.rb similarity index 96% rename from spec/state_spec.rb rename to spec/unit/state_spec.rb index 206c495..f3ab381 100644 --- a/spec/state_spec.rb +++ b/spec/unit/state_spec.rb @@ -1,4 +1,4 @@ -require File.join(File.dirname(__FILE__), '..', 'lib', 'state') +require File.join(File.dirname(__FILE__), '..', 'spec_helper') diff --git a/spec/state_transition_spec.rb b/spec/unit/state_transition_spec.rb similarity index 96% rename from spec/state_transition_spec.rb rename to spec/unit/state_transition_spec.rb index 8296947..46b32b2 100644 --- a/spec/state_transition_spec.rb +++ b/spec/unit/state_transition_spec.rb @@ -1,4 +1,4 @@ -require File.join(File.dirname(__FILE__), '..', 'lib', 'state_transition') +require File.join(File.dirname(__FILE__), '..', 'spec_helper') describe AASM::SupportingClasses::StateTransition do it 'should set from, to, and opts attr readers' do