From 6c6d67e12dbb363ddb75d5b36925a0d9bddbb770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=CC=81mi=20Pre=CC=81vost?= Date: Mon, 10 Oct 2011 08:54:26 -0400 Subject: [PATCH] Follow spec conventions for filenames --- Rakefile | 4 +++- spec/{examples => fixtures}/layouts.yml | 0 spec/{layout.rb => layout_spec.rb} | 2 +- spec/spec_helper.rb | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) rename spec/{examples => fixtures}/layouts.yml (100%) rename spec/{layout.rb => layout_spec.rb} (80%) 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