Sha256: 6553f449c9247f3dcd176808bbecba63fc2c1cc3038f5a8c8f704404c234f8b6

Contents?: true

Size: 1.03 KB

Versions: 10

Compression:

Stored size: 1.03 KB

Contents

# The following allows us to have a nested directory structure of specs.  With
# a lot of specs this is needed.
Evergreen.configure do |config|
  config.root = Temporal::Engine.root
end

module Evergreen
  class Suite
    def specs
      Dir.glob(File.join(root, Evergreen.spec_dir, '**', '*_spec.{js,coffee,js.coffee}')).map do |path|
        Spec.new(self, path.gsub(File.join(root), ''))
      end
    end

    def templates
      Dir.glob(File.join(root, Evergreen.template_dir, '**', '*')).map do |path|
        Template.new(self, path.gsub(File.join(root), '')) unless File.directory?(path)
      end.compact
    end
  end
end

module Evergreen
  class Spec
    def initialize(suite, name)
      @suite = suite
      @name = name
      @name = "#{Evergreen.spec_dir}/#{name}" if !exist?
    end

    def name
      @name.gsub("/#{Evergreen.spec_dir}/", '')
    end
  end
end

module Evergreen
  class Template
    def name
      @name.gsub("/#{Evergreen.template_dir}/", '')
    end

    def full_path
      File.join(root, @name)
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
navigasmic-1.1.0 spec/dummy/config/evergreen.rb
navigasmic-1.0.5 spec/dummy/config/evergreen.rb
navigasmic-1.0.4 spec/dummy/config/evergreen.rb
temporal-rails-0.2.2 spec/dummy/config/evergreen.rb
navigasmic-1.0.3 spec/dummy/config/evergreen.rb
navigasmic-1.0.2 spec/dummy/config/evergreen.rb
navigasmic-1.0.1 spec/dummy/config/evergreen.rb
navigasmic-1.0.0 spec/dummy/config/evergreen.rb
temporal-rails-0.2.1 spec/dummy/config/evergreen.rb
temporal-rails-0.2.0 spec/dummy/config/evergreen.rb