Sha256: 921f49681a2908c8d11df0ff541dfe526ffc6f1357356298a9755fb824daa0d7

Contents?: true

Size: 357 Bytes

Versions: 15

Compression:

Stored size: 357 Bytes

Contents

module TestDummy::TestHelper
  def dummy(scope, options = { })
    instance = scope.respond_to?(:build) ? scope.build(options) : scope.new(options)

    if (block_given?)
      yield(instance)
    end
    
    instance.dummy!
    
    instance.save!
    instance
  end
  alias_method :a, :dummy
  alias_method :an, :dummy
  alias_method :one_of, :dummy
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
test_dummy-0.4.0 lib/test_dummy/test_helper.rb
test_dummy-0.3.0 lib/test_dummy/test_helper.rb
test_dummy-0.2.10 lib/test_dummy/test_helper.rb
test_dummy-0.2.9 lib/test_dummy/test_helper.rb
test_dummy-0.2.8 lib/test_dummy/test_helper.rb
test_dummy-0.2.7 lib/test_dummy/test_helper.rb
test_dummy-0.2.6 lib/test_dummy/test_helper.rb
test_dummy-0.2.5 lib/test_dummy/test_helper.rb
test_dummy-0.2.4 lib/test_dummy/test_helper.rb
test_dummy-0.2.3 lib/test_dummy/test_helper.rb
test_dummy-0.2.2 lib/test_dummy/test_helper.rb
test_dummy-0.2.1 lib/test_dummy/test_helper.rb
test_dummy-0.2.0 lib/test_dummy/test_helper.rb
test_dummy-0.1.4 lib/test_dummy/test_helper.rb
test_dummy-0.1.3 lib/test_dummy/test_helper.rb