Skip to content

Instantly share code, notes, and snippets.

@floehopper
Last active June 22, 2018 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floehopper/31c109be5fddd5e3a76fa9d3165268ff to your computer and use it in GitHub Desktop.
Save floehopper/31c109be5fddd5e3a76fa9d3165268ff to your computer and use it in GitHub Desktop.
Mocha issue 329
source 'https://rubygems.org'
gem 'rspec'
$ bundle
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using bundler 1.16.1
Fetching diff-lcs 1.3
Installing diff-lcs 1.3
Fetching metaclass 0.0.4
Installing metaclass 0.0.4
Fetching mocha 1.5.0
Installing mocha 1.5.0
Fetching rspec-support 3.7.1
Installing rspec-support 3.7.1
Fetching rspec-core 3.7.1
Installing rspec-core 3.7.1
Fetching rspec-expectations 3.7.0
Installing rspec-expectations 3.7.0
Fetching rspec-mocks 3.7.0
Installing rspec-mocks 3.7.0
Fetching rspec 3.7.0
Installing rspec 3.7.0
Bundle complete! 2 Gemfile dependencies, 9 gems now installed.
Bundled gems are installed into `./.bundle/gems`
$ rspec test_spec.rb
.
Finished in 0.00334 seconds (files took 0.11658 seconds to load)
1 example, 0 failures
require 'bundler/setup'
require 'rspec'
require 'mocha'
RSpec.configure do |config|
config.mock_with :mocha
end
RSpec.describe "test" do
before(:each) do
@name = 'viyou'
@name.expects(:size).returns 100
end
describe "test" do
it "test" do
expect(@name).to eq 'viyou'
expect(@name.size).to eq 100
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment