Skip to content

Instantly share code, notes, and snippets.

@tadas-s
Created August 6, 2020 08:38
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 tadas-s/2f9a6918ac614b75d80f2f79960e845f to your computer and use it in GitHub Desktop.
Save tadas-s/2f9a6918ac614b75d80f2f79960e845f to your computer and use it in GitHub Desktop.
An example of bundler's inline feature used with rspec
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile do
source 'https://rubygems.org'
gem 'rspec'
end
require 'rspec/autorun'
class HelloWorld
def say_hello
'Hello World!'
end
end
describe HelloWorld do
it 'says hello' do
expect(subject.say_hello).to eq 'Hello World!'
end
end
@tadas-s
Copy link
Author

tadas-s commented Aug 6, 2020

Output of this in use:

09:37 $ ruby ./scaffold.rb 
.

Finished in 0.00116 seconds (files took 0.04594 seconds to load)
1 example, 0 failures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment