Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use mocha in examples

  • Loading branch information...
commit 1d8156b7f55ac28d84dd36b0680182eb5904e78b 1 parent 6bd24b9
@farnoy authored
Showing with 18 additions and 1 deletion.
  1. +14 −0 spec/other_spec.rb
  2. +4 −1 spec/test_spec.rb
View
14 spec/other_spec.rb
@@ -0,0 +1,14 @@
+require 'minitest/spec'
+MiniTest::Unit.autorun
+require 'rspec/expectations'
+require 'rspec/matchers'
+require 'mocha'
+
+describe "Testing framework other" do
+ it "executes" do
+ user = stub(:money => 50)
+ order = stub(:total_amount => 49.99)
+
+ user.money.should satisfy { |money| money > order.total_amount }
+ end
+end
View
5 spec/test_spec.rb
@@ -2,9 +2,12 @@
MiniTest::Unit.autorun
require 'rspec/expectations'
require 'rspec/matchers'
+require 'mocha'
describe "Testing framework" do
it "executes" do
- assert_equal 3, 3
+ user = Struct.new("User", :name).new('kuba')
+ user.stubs(:age).returns(3)
+ 3.should eq(user.age)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.