Class: InfinityTest::TestLibrary::Bacon

Inherits:
InfinityTest::TestFramework show all
Defined in:
lib/infinity_test/test_library/bacon.rb

Instance Attribute Summary

Attributes inherited from InfinityTest::TestFramework

#application, #message, #rubies, #specific_options, #test_pattern

Instance Method Summary collapse

Methods inherited from InfinityTest::TestFramework

#all_files, create_accessors, #create_pattern_instance_variables, #decide_files, parse_results, #test_files, #test_message

Methods included from Builder

#construct_command, #construct_commands, #resolve_options, #run_with_bundler!, #run_without_bundler!

Methods included from Environment

#environments

Methods included from BinaryPath

#have_binary?, included, #print_message, #rvm_bin_path, #search_binary

Constructor Details

#initialize(options = {}) ⇒ Bacon

Bacon Framework

For more information about the Bacon see: github.com/chneukirchen/bacon

bacon = InfinityTest::Bacon.new(:rubies => ‘1.9.1,1.9.2’) bacon.rubies # => ‘1.9.1,1.9.2’ bacon.test_directory_pattern # => “^spec/*/(.*)_spec.rb” bacon.test_pattern # => ‘spec/*/_spec.rb’



16
17
18
19
# File 'lib/infinity_test/test_library/bacon.rb', line 16

def initialize(options={})
  super(options)
  @test_pattern = 'spec/**/*_spec.rb'
end

Instance Method Details

#construct_rubies_commands(file = nil) ⇒ Object

Construct all the commands for each ruby First, try to find the bacon binary, and raise/puts an Error if don’t find it. After that, verifying if the user have a Gemfile, and if has, run with “bundle exec” command, else will run normally



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/infinity_test/test_library/bacon.rb', line 25

def construct_rubies_commands(file=nil)
  commands = {}
  environments do |environment, ruby_version|
    bacon_binary = search_bacon(environment)
    command = construct_command(
                  :for => ruby_version,
                  :binary => bacon_binary,
                  :load_path => 'lib:spec',
                  :file => file,
                  :environment => environment) || next
    commands[ruby_version] = command
  end
  commands
end

#failure?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/infinity_test/test_library/bacon.rb', line 45

def failure?
  @failures > 0
end

#pending?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/infinity_test/test_library/bacon.rb', line 49

def pending?
  false # Don't have pending in Bacon
end

#sucess?Boolean

Returns:

  • (Boolean)


40
41
42
43
# File 'lib/infinity_test/test_library/bacon.rb', line 40

def sucess?
  return false if failure?
  true
end