Instantly share code, notes, and snippets.

@floehopper /Gemfile
Last active Jun 22, 2018

Embed
What would you like to do?
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