Class: Aruba::Initializers::MiniTestInitializer

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/aruba/initializer.rb

Overview

Minitest Initializer. Adds Aruba + Minitest to project

Instance Method Summary collapse

Instance Method Details

#create_exampleObject



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/aruba/initializer.rb', line 145

def create_example
  create_file 'test/use_aruba_with_minitest.rb', "    $LOAD_PATH.unshift File.expand_path('../test', __FILE__)\n\n    require 'test_helper'\n    require 'minitest/autorun'\n    require 'aruba/api'\n\n    class FirstRun < Minitest::Test\n      include Aruba::Api\n\n      def setup\n        setup_aruba\n      end\n\n      def test_dummy\n        skip \"Add some real tests here\"\n      end\n    end\n  EOS\nend\n"

#create_helperObject



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/aruba/initializer.rb', line 129

def create_helper
  file =  'test/test_helper.rb'
  creator = if File.exist? file
              :append_to_file
            else
              :create_file
            end

  send creator, file, "    $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\n\n    ::Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each { |f| require_relative f }\n    ::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require_relative f }\n  EOS\nend\n"