Skip to content

yea #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open

yea #30

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ce4d817
Create README.md
eriktrautman Aug 14, 2014
d1f0abf
fix rakefile
eriktrautman Jan 7, 2015
f44c467
update README
eriktrautman Jan 7, 2015
2083f1f
update be_false to be false as per rspec 3
eriktrautman Mar 14, 2015
6322003
Update Gemfile
eriktrautman May 22, 2015
15fa856
Update rspec_config.rb
eriktrautman May 22, 2015
e4f3978
Update dictionary_spec.rb
eriktrautman Jun 19, 2015
eca1c5e
fix typo
eriktrautman Jun 19, 2015
6736c4a
Fix hanging chad
eriktrautman Jun 19, 2015
9faf2fb
Update README.md
eriktrautman Jul 13, 2015
1c26685
Finished hello and temperature exercise
strychemi Aug 29, 2015
4a2c36e
finished calculator exercise
strychemi Aug 29, 2015
fe04c59
finished simon_says exercise
strychemi Aug 29, 2015
ed0dc39
finished pig_latin exercise
strychemi Aug 30, 2015
db0496d
finished silly_blocks exercise
strychemi Aug 30, 2015
cd13108
finished performance_monitor exercise
strychemi Aug 30, 2015
990bb10
finished hello_friend exercise
strychemi Aug 30, 2015
b6f0f63
finished book_titles exercise
strychemi Aug 30, 2015
fc1a670
finished timer exercise
strychemi Aug 30, 2015
cd9d111
refactored timer exercise
strychemi Aug 30, 2015
b4b3c18
finished temperuture_object exercise
strychemi Aug 30, 2015
4634f22
finished dictionary exercise
strychemi Aug 30, 2015
b7a4ee7
finished rpn_calculator exercise
strychemi Aug 30, 2015
941554e
will come back to xml exercise if time allows
strychemi Aug 30, 2015
daef751
finished array_extensions exercise
strychemi Aug 30, 2015
a225579
finished in_words exercise
strychemi Aug 30, 2015
465655b
changed rspec syntax to 3.0+ and finished XML exercise
strychemi Nov 14, 2015
c72208e
removed my solutions to learn_ruby excercises
strychemi Nov 14, 2015
cb75401
Merge pull request #24 from strychemi/rspec-only
eriktrautman Nov 14, 2015
2d66244
Update README.md
eriktrautman Nov 14, 2015
858defa
replaced Time.stub syntax to allow(Time)
strychemi Nov 15, 2015
3abb5d4
updated html RSpec syntax with minor fixes
strychemi Nov 16, 2015
0685d6c
Merge pull request #27 from strychemi/rspec-only
eriktrautman Nov 16, 2015
30ac9fb
Update README.md
eriktrautman Nov 16, 2015
290917d
Escape the file path passed to rspec_opts
kitlangton Sep 13, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.idea

+.DS_Store*
18 changes: 9 additions & 9 deletions 00_hello/hello_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#
# You should see an error. **Don't get scared!** Try to read it and figure out what the computer wants to tell you. Somewhere on the first line it should say something like
#
# no such file to load -- test-first-teaching/hello/hello (LoadError)
# cannot load such file -- test-first-teaching/hello/hello (LoadError)
#
# That means that it is looking for a file called `hello.rb` and can't find it.
#
Expand All @@ -36,7 +36,7 @@
# Failures:
#
# 1) the hello function says hello
# Failure/Error: hello.should == "Hello!"
# Failure/Error: expect(hello).to eq("Hello!")
# NameError:
# undefined local variable or method `hello' for #<RSpec::Core::ExampleGroup::Nested_1:0x000001009b8808>
# # ./hello/hello_spec.rb:5:in `block (2 levels) in <top (required)>'
Expand All @@ -60,9 +60,9 @@
# Failures:
#
# 1) the hello function says hello
# Failure/Error: hello().should == "Hello!"
# Failure/Error: expect(hello).to eq("Hello!")
# expected: "Hello!"
# got: nil (using ==)
# got: nil (compared using ==)
# # ./hello/hello_spec.rb:5:in `block (2 levels) in <top (required)>'
#
# This means that while it found the file, and it found the function, it's not returning anything! ("nil" is the Ruby way of saying "not anything".)
Expand All @@ -82,9 +82,9 @@
# Now you should see an error like this:
#
# 1) the hello function says hello
# Failure/Error: hello().should == "Hello!"
# Failure/Error: expect(hello.to eq("Hello!")
# expected: "Hello!"
# got: "whuh?" (using ==)
# got: "whuh?" (compared using ==)
# # ./hello/hello_spec.rb:5:in `block (2 levels) in <top (required)>'
#
# Correct this by changing "whuh?" to "Hello!". Save it. Run the test again.
Expand Down Expand Up @@ -117,16 +117,16 @@

describe "the hello function" do
it "says hello" do
hello.should == "Hello!"
expect(hello).to eq("Hello!")
end
end

describe "the greet function" do
it "says hello to someone" do
greet("Alice").should == "Hello, Alice!"
expect(greet("Alice")).to eq("Hello, Alice!")
end

it "says hello to someone else" do
greet("Bob").should == "Hello, Bob!"
expect(greet("Bob")).to eq("Hello, Bob!")
end
end
18 changes: 9 additions & 9 deletions 00_hello/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h2>Watch it fail</h2>

<p>You should see an error. <strong>Don't get scared!</strong> Try to read it and figure out what the computer wants to tell you. Somewhere on the first line it should say something like</p>

<pre><code>no such file to load -- test-first-teaching/hello/hello (LoadError)
<pre><code>cannot load such file -- test-first-teaching/hello/hello (LoadError)
</code></pre>

<p>That means that it is looking for a file called <code>hello.rb</code> and can't find it.</p>
Expand All @@ -73,7 +73,7 @@ <h2>Watch it fail</h2>
Failures:

1) the hello function says hello
Failure/Error: hello.should == "Hello!"
Failure/Error: expect(hello).to eq("Hello!")
NameError:
undefined local variable or method `hello' for #&lt;RSpec::Core::ExampleGroup::Nested_1:0x000001009b8808&gt;
# ./hello/hello_spec.rb:5:in `block (2 levels) in &lt;top (required)&gt;'
Expand All @@ -99,9 +99,9 @@ <h2>Watch it fail</h2>
Failures:

1) the hello function says hello
Failure/Error: hello().should == "Hello!"
Failure/Error: expect(hello).to eq("Hello!")
expected: "Hello!"
got: nil (using ==)
got: nil (compared using ==)
# ./hello/hello_spec.rb:5:in `block (2 levels) in &lt;top (required)&gt;'
</code></pre>

Expand All @@ -123,9 +123,9 @@ <h2>Watch it fail</h2>
<p>Now you should see an error like this:</p>

<pre><code>1) the hello function says hello
Failure/Error: hello().should == "Hello!"
Failure/Error: expect(hello).to eq("Hello!")
expected: "Hello!"
got: "whuh?" (using ==)
got: "whuh?" (compared using ==)
# ./hello/hello_spec.rb:5:in `block (2 levels) in &lt;top (required)&gt;'
</code></pre>

Expand Down Expand Up @@ -164,17 +164,17 @@ <h1>Tests</h1>

describe &quot;the hello function&quot; do
it &quot;says hello&quot; do
hello.should == &quot;Hello!&quot;
expect(hello).to eq(&quot;Hello!&quot;)
end
end

describe &quot;the greet function&quot; do
it &quot;says hello to someone&quot; do
greet(&quot;Alice&quot;).should == &quot;Hello, Alice!&quot;
expect(greet(&quot;Alice&quot;)).to eq(&quot;Hello, Alice!&quot;)
end

it &quot;says hello to someone else&quot; do
greet(&quot;Bob&quot;).should == &quot;Hello, Bob!&quot;
expect(greet(&quot;Bob&quot;)).to eq(&quot;Hello, Bob!&quot;)
end
end</pre>
</div>
Expand Down
16 changes: 8 additions & 8 deletions 01_temperature/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,39 +62,39 @@ <h1>Tests</h1>
describe &quot;#ftoc&quot; do

it &quot;converts freezing temperature&quot; do
ftoc(32).should == 0
expect(ftoc(32)).to eq(0)
end

it &quot;converts boiling temperature&quot; do
ftoc(212).should == 100
expect(ftoc(212)).to eq(100)
end

it &quot;converts body temperature&quot; do
ftoc(98.6).should == 37
expect(ftoc(98.6)).to eq(37)
end

it &quot;converts arbitrary temperature&quot; do
ftoc(68).should == 20
expect(ftoc(68)).to eq(20)
end

end

describe &quot;#ctof&quot; do

it &quot;converts freezing temperature&quot; do
ctof(0).should == 32
expect(ctof(0)).to eq(32)
end

it &quot;converts boiling temperature&quot; do
ctof(100).should == 212
expect(ctof(100)).to eq(212)
end

it &quot;converts arbitrary temperature&quot; do
ctof(20).should == 68
expect(ctof(20)).to eq(68)
end

it &quot;converts body temperature&quot; do
ctof(37).should be_within(0.1).of(98.6)
expect(ctof(37)).to be_within(0.1).of(98.6)
# Why do we need to use be_within?
# See http://www.ruby-forum.com/topic/169330
# and http://en.wikipedia.org/wiki/IEEE_754-2008
Expand Down
16 changes: 8 additions & 8 deletions 01_temperature/temperature_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,39 +22,39 @@
describe "#ftoc" do

it "converts freezing temperature" do
ftoc(32).should == 0
expect(ftoc(32)).to eq(0)
end

it "converts boiling temperature" do
ftoc(212).should == 100
expect(ftoc(212)).to eq(100)
end

it "converts body temperature" do
ftoc(98.6).should == 37
expect(ftoc(98.6)).to eq(37)
end

it "converts arbitrary temperature" do
ftoc(68).should == 20
expect(ftoc(68)).to eq(20)
end

end

describe "#ctof" do

it "converts freezing temperature" do
ctof(0).should == 32
expect(ctof(0)).to eq(32)
end

it "converts boiling temperature" do
ctof(100).should == 212
expect(ctof(100)).to eq(212)
end

it "converts arbitrary temperature" do
ctof(20).should == 68
expect(ctof(20)).to eq(68)
end

it "converts body temperature" do
ctof(37).should be_within(0.1).of(98.6)
expect(ctof(37)).to be_within(0.1).of(98.6)
# Why do we need to use be_within?
# See http://www.ruby-forum.com/topic/169330
# and http://en.wikipedia.org/wiki/IEEE_754-2008
Expand Down
18 changes: 9 additions & 9 deletions 02_calculator/calculator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,39 @@

describe "add" do
it "adds 0 and 0" do
add(0,0).should == 0
expect(add(0,0)).to eq(0)
end

it "adds 2 and 2" do
add(2,2).should == 4
expect(add(2,2)).to eq(4)
end

it "adds positive numbers" do
add(2,6).should == 8
expect(add(2,6)).to eq(8)
end
end

describe "subtract" do
it "subtracts numbers" do
subtract(10,4).should == 6
expect(subtract(10,4)).to eq(6)
end
end

describe "sum" do
it "computes the sum of an empty array" do
sum([]).should == 0
expect(sum([])).to eq(0)
end

it "computes the sum of an array of one number" do
sum([7]).should == 7
expect(sum([7])).to eq(7)
end

it "computes the sum of an array of two numbers" do
sum([7,11]).should == 18
expect(sum([7,11])).to eq(18)
end

it "computes the sum of an array of many numbers" do
sum([1,3,5,7,9]).should == 25
expect(sum([1,3,5,7,9])).to eq(25)
end
end

Expand All @@ -82,7 +82,7 @@
it "multiplies two numbers"

it "multiplies several numbers"

end

describe "#power" do
Expand Down
16 changes: 8 additions & 8 deletions 02_calculator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,39 +78,39 @@ <h1>Tests</h1>

describe &quot;add&quot; do
it &quot;adds 0 and 0&quot; do
add(0,0).should == 0
expect(add(0,0)).to eq(0)
end

it &quot;adds 2 and 2&quot; do
add(2,2).should == 4
expect(add(2,2)).to eq(4)
end

it &quot;adds positive numbers&quot; do
add(2,6).should == 8
expect(add(2,6)).to eq(8)
end
end

describe &quot;subtract&quot; do
it &quot;subtracts numbers&quot; do
subtract(10,4).should == 6
expect(subtract(10,4)).to eq(6)
end
end

describe &quot;sum&quot; do
it &quot;computes the sum of an empty array&quot; do
sum([]).should == 0
expect(sum([])).to eq(0)
end

it &quot;computes the sum of an array of one number&quot; do
sum([7]).should == 7
expect(sum([7])).to eq(7)
end

it &quot;computes the sum of an array of two numbers&quot; do
sum([7,11]).should == 18
expect(sum([7,11])).to eq(18)
end

it &quot;computes the sum of an array of many numbers&quot; do
sum([1,3,5,7,9]).should == 25
expect(sum([1,3,5,7,9])).to eq(25)
end
end

Expand Down
Loading