diff --git a/Rakefile b/Rakefile index fd939cf..1e9bbb2 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,8 @@ +require "bundler/gem_tasks" + desc "Run specs" task :spec do # {{{ - sh "bundle exec rspec --color --format=nested #{File.join(File.dirname(__FILE__), "spec/layout.rb")}" + sh "bundle exec rspec --color --format=nested #{Dir.glob(File.join(File.dirname(__FILE__), "spec/**/*_spec.rb")).join(" ")}" end # }}} desc "Generate documentation" diff --git a/spec/examples/layouts.yml b/spec/fixtures/layouts.yml similarity index 100% rename from spec/examples/layouts.yml rename to spec/fixtures/layouts.yml diff --git a/spec/layout.rb b/spec/layout_spec.rb similarity index 80% rename from spec/layout.rb rename to spec/layout_spec.rb index 571d772..41d44c8 100644 --- a/spec/layout.rb +++ b/spec/layout_spec.rb @@ -4,7 +4,7 @@ describe Teamocil::Layout do context "initializing" do it "create two windows" do # {{{ - layout = Teamocil::Layout.new(examples["two-windows"], {}) + layout = Teamocil::Layout.new(layouts["two-windows"], {}) commands = layout.generate_commands commands.grep(/new-window/).length.should be 2 end # }}} diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 272f79c..c5968e0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,9 +5,9 @@ require 'teamocil' module Helpers - def examples # {{{ + def layouts # {{{ return @@examples if defined?(@@examples) - @@examples = YAML.load_file(File.join(File.dirname(__FILE__), "examples/layouts.yml")) + @@examples = YAML.load_file(File.join(File.dirname(__FILE__), "fixtures/layouts.yml")) end # }}} end