Last active
June 22, 2018 13:35
-
-
Save floehopper/31c109be5fddd5e3a76fa9d3165268ff to your computer and use it in GitHub Desktop.
Mocha issue 329
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'rspec' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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