Sha256: d76005fdb25d18c22307658043ce22f3a83a0153cb2f0322e806427e7c7ce1b0

Contents?: true

Size: 491 Bytes

Versions: 86

Compression:

Stored size: 491 Bytes

Contents

class Enterprise

  def initialize(dilithium)
    @dilithium = dilithium
  end

  def go(warp_factor)
    warp_factor.times { @dilithium.nuke(:anti_matter) }
  end

end

require 'test/unit'
require 'rubygems'
require 'mocha'

class EnterpriseTest < Test::Unit::TestCase

  def test_should_boldly_go
    dilithium = mock()
    dilithium.expects(:nuke).with(:anti_matter).at_least_once  # auto-verified at end of test
    enterprise = Enterprise.new(dilithium)
    enterprise.go(2)
  end

end

Version data entries

86 entries across 86 versions & 10 rubygems

Version Path
floehopper-mocha-0.9.3.20081220175348 examples/mocha.rb
floehopper-mocha-0.9.3.20081230175553 examples/mocha.rb
floehopper-mocha-0.9.4.20090128164727 examples/mocha.rb
floehopper-mocha-0.9.5.20090201123802 examples/mocha.rb
greatseth-google-geo-2.0 vendor/mocha-0.4.0/examples/mocha.rb
greatseth-google-geo-2.1 vendor/mocha-0.4.0/examples/mocha.rb
greatseth-google-geo-2.2 vendor/mocha-0.4.0/examples/mocha.rb
gsterndale-warrant-0.2.0 test/rails_root/vendor/gems/mocha-0.9.4/examples/mocha.rb
gsterndale-warrant-0.3.0 test/rails_root/vendor/gems/mocha-0.9.4/examples/mocha.rb
hashrocket-clearance-0.4.0 test/rails_root/vendor/gems/mocha-0.9.1/examples/mocha.rb
hashrocket-clearance-0.4.1 test/rails_root/vendor/gems/mocha-0.9.1/examples/mocha.rb
hashrocket-clearance-0.4.2 test/rails_root/vendor/gems/mocha-0.9.1/examples/mocha.rb
hashrocket-clearance-0.4.3 test/rails_root/vendor/gems/mocha-0.9.1/examples/mocha.rb
thewoolleyman-mocha-0.9.3.20081219131457 examples/mocha.rb
thoughtbot-clearance-0.2.2 test/rails_root/vendor/gems/mocha-0.9.1/examples/mocha.rb
thoughtbot-clearance-0.2.3 test/rails_root/vendor/gems/mocha-0.9.1/examples/mocha.rb
thoughtbot-clearance-0.2.4 test/rails_root/vendor/gems/mocha-0.9.1/examples/mocha.rb
thoughtbot-clearance-0.2.5 test/rails_root/vendor/gems/mocha-0.9.1/examples/mocha.rb
thoughtbot-clearance-0.2.6 test/rails_root/vendor/gems/mocha-0.9.1/examples/mocha.rb
thoughtbot-clearance-0.2.7 test/rails_root/vendor/gems/mocha-0.9.1/examples/mocha.rb