Sha256: 43a7e3c9b2b6fe6f0e7f6bd8e1869f342800b997ab1f6de0c3bb0b94cd84c85b

Contents?: true

Size: 658 Bytes

Versions: 14

Compression:

Stored size: 658 Bytes

Contents

RSpec.shared_context "nucleon_test" do

  #*****************************************************************************
  # Reusable Nucleon tests

  def test_type(this, klass)
    expect(this).to be_kind_of(klass)
  end


  def test_eq(this, that)
    expect(this).to eq(that)
  end

  def test_config(config, state)
    test_eq(config.export, state)
  end


  def test_output(message, printer = :puts)
    handle = double('output')
    expect(handle).to receive(printer).with(message)
    yield(handle) if block_given?
    handle
  end


  def test_object(klass, *args)
    object = klass.new(*args)
    yield(object) if block_given?
    object
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
nucleon-0.2.16 spec/nucleon_test.rb
nucleon-0.2.15 spec/nucleon_test.rb
nucleon-0.2.14 spec/nucleon_test.rb
nucleon-0.2.13 spec/nucleon_test.rb
nucleon-0.2.12 spec/nucleon_test.rb
nucleon-0.2.11 spec/nucleon_test.rb
nucleon-0.2.10 spec/nucleon_test.rb
nucleon-0.2.9 spec/nucleon_test.rb
nucleon-0.2.8 spec/nucleon_test.rb
nucleon-0.2.7 spec/nucleon_test.rb
nucleon-0.2.6 spec/nucleon_test.rb
nucleon-0.2.5 spec/nucleon_test.rb
nucleon-0.2.4 spec/nucleon_test.rb
nucleon-0.2.3 spec/nucleon_test.rb