Skip to content

Commit 43e735f

Browse files
committed
Initial commit
0 parents  commit 43e735f

File tree

5 files changed

+123
-0
lines changed

5 files changed

+123
-0
lines changed

.rspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--color
2+
--require spec_helper

README.md

Whitespace-only changes.

lib/a_broken_program.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# What is a Program?
2+
3+
puts "This is a program"
4+
puts "Programs are interpreted at runtime."
5+
puts "Which means even though I'm writing this Tue Jan 17 2012 8:36am"
6+
puts "the time now is "+ Time.now.to_s
7+
8+
puts "Programs have flow."
9+
puts "Which means that you see this first"
10+
puts "and this next."
11+
12+
puts "Lines of code are executed linearly, that's flow."
13+
puts "First come, first served."
14+
15+
puts "Programs are composed of basically three things:"
16+
17+
puts "A language's keywords, like 'if' or 'end' (approximately 43)."
18+
puts "Literal pieces of data like this very sentence (or String)."
19+
puts "Finally, barewords, or variables, that are set equal to things."
20+
21+
puts "Anything that isn't one of those will cause an error."
22+
23+
see

spec/a_broken_program_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
describe 'A broken program' do
2+
3+
it 'raises an error when loaded' do
4+
expect{
5+
load '../lib/a_broken_program'
6+
}.to raise_error
7+
end
8+
9+
end

spec/spec_helper.rb

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# This file was generated by the `rspec --init` command. Conventionally, all
2+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
4+
# file to always be loaded, without a need to explicitly require it in any files.
5+
#
6+
# Given that it is always loaded, you are encouraged to keep this file as
7+
# light-weight as possible. Requiring heavyweight dependencies from this file
8+
# will add to the boot time of your test suite on EVERY test run, even for an
9+
# individual file that may not need all of that loaded. Instead, consider making
10+
# a separate helper file that requires the additional dependencies and performs
11+
# the additional setup, and require it from the spec files that actually need it.
12+
#
13+
# The `.rspec` file also contains a few flags that are not defaults but that
14+
# users commonly want.
15+
#
16+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
17+
RSpec.configure do |config|
18+
# rspec-expectations config goes here. You can use an alternate
19+
# assertion/expectation library such as wrong or the stdlib/minitest
20+
# assertions if you prefer.
21+
config.expect_with :rspec do |expectations|
22+
# This option will default to `true` in RSpec 4. It makes the `description`
23+
# and `failure_message` of custom matchers include text for helper methods
24+
# defined using `chain`, e.g.:
25+
# be_bigger_than(2).and_smaller_than(4).description
26+
# # => "be bigger than 2 and smaller than 4"
27+
# ...rather than:
28+
# # => "be bigger than 2"
29+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
30+
end
31+
32+
# rspec-mocks config goes here. You can use an alternate test double
33+
# library (such as bogus or mocha) by changing the `mock_with` option here.
34+
config.mock_with :rspec do |mocks|
35+
# Prevents you from mocking or stubbing a method that does not exist on
36+
# a real object. This is generally recommended, and will default to
37+
# `true` in RSpec 4.
38+
mocks.verify_partial_doubles = true
39+
end
40+
41+
# The settings below are suggested to provide a good initial experience
42+
# with RSpec, but feel free to customize to your heart's content.
43+
=begin
44+
# These two settings work together to allow you to limit a spec run
45+
# to individual examples or groups you care about by tagging them with
46+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
47+
# get run.
48+
config.filter_run :focus
49+
config.run_all_when_everything_filtered = true
50+
51+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
52+
# For more details, see:
53+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
54+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
55+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
56+
config.disable_monkey_patching!
57+
58+
# This setting enables warnings. It's recommended, but in some cases may
59+
# be too noisy due to issues in dependencies.
60+
config.warnings = true
61+
62+
# Many RSpec users commonly either run the entire suite or an individual
63+
# file, and it's useful to allow more verbose output when running an
64+
# individual spec file.
65+
if config.files_to_run.one?
66+
# Use the documentation formatter for detailed output,
67+
# unless a formatter has already been configured
68+
# (e.g. via a command-line flag).
69+
config.default_formatter = 'doc'
70+
end
71+
72+
# Print the 10 slowest examples and example groups at the
73+
# end of the spec run, to help surface which specs are running
74+
# particularly slow.
75+
config.profile_examples = 10
76+
77+
# Run specs in random order to surface order dependencies. If you find an
78+
# order dependency and want to debug it, you can fix the order by providing
79+
# the seed, which is printed after each run.
80+
# --seed 1234
81+
config.order = :random
82+
83+
# Seed global randomization in this process using the `--seed` CLI option.
84+
# Setting this allows you to use `--seed` to deterministically reproduce
85+
# test failures related to randomization by passing the same `--seed` value
86+
# as the one that triggered the failure.
87+
Kernel.srand config.seed
88+
=end
89+
end

0 commit comments

Comments
 (0)