Skip to content

Commit 369f024

Browse files
committed
Done.
1 parent e29bec2 commit 369f024

8 files changed

+97
-82
lines changed

.learn

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tags:
2-
- tag1
2+
- learn
33
languages:
4-
- language1
5-
resources: 0
4+
- learn
5+
resources: 0

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ source "https://rubygems.org"
44
# gem "rails"
55

66
gem 'rspec'
7-
gem 'pry'
7+
gem 'pry'

Gemfile.lock

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
coderay (1.1.0)
5+
diff-lcs (1.2.5)
6+
method_source (0.8.2)
7+
pry (0.10.1)
8+
coderay (~> 1.1.0)
9+
method_source (~> 0.8.1)
10+
slop (~> 3.4)
11+
rspec (3.3.0)
12+
rspec-core (~> 3.3.0)
13+
rspec-expectations (~> 3.3.0)
14+
rspec-mocks (~> 3.3.0)
15+
rspec-core (3.3.2)
16+
rspec-support (~> 3.3.0)
17+
rspec-expectations (3.3.1)
18+
diff-lcs (>= 1.2.0, < 2.0)
19+
rspec-support (~> 3.3.0)
20+
rspec-mocks (3.3.2)
21+
diff-lcs (>= 1.2.0, < 2.0)
22+
rspec-support (~> 3.3.0)
23+
rspec-support (3.3.0)
24+
slop (3.6.0)
25+
26+
PLATFORMS
27+
ruby
28+
29+
DEPENDENCIES
30+
pry
31+
rspec
32+
33+
BUNDLED WITH
34+
1.10.6

README.md

+48
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,53 @@
11
# First Lab Ruby Learn Cli Osx
22

3+
## Objectives
4+
5+
1. Open a lab by clicking "Open" on this page on Learn.co.
6+
2. Run the lab's tests with the `learn` CLI command.
7+
3. Make a change to your local copy of this lab.
8+
4. Pass the tests using the `learn` CLI command.
9+
5. Submit the passing lab with the `learn submit` CLI command.
10+
11+
## Instructions
12+
13+
This lab is just about practicing the lab workflow on Learn using the `learn` CLI.
14+
15+
1. Click on the "Open" link on the lab toolbar above.
16+
17+
![Open Button](https://dl.dropboxusercontent.com/s/6hmrbrtcf0gssev/2015-09-30%20at%207.11%20PM.png)
18+
19+
After you click on this, your Terminal should popup and open the lab locally by forking it on GitHub, cloning your fork, and `cd`ing into the lab's directory, and opening your editor.
20+
21+
![Learn Open](http://learn-co-videos.s3.amazonaws.com/learn-co-orientation/open-from-learn-co.gif)
22+
23+
2. After the lab is opened, your terminal should be in the lab's directory and your text editor should be opened.
24+
25+
![Work mode](https://dl.dropboxusercontent.com/s/je5pazo2edy5cwl/2015-09-30%20at%207.34%20PM.png)
26+
27+
This setup, a terminal in the lab's directory and the lab directory open in an editor like Sublime or Atom, that's the state you want to be in when working on a lab on Learn. It means you're ready.
28+
29+
3. From your terminal, run the test suite by typing `learn` and hitting enter. You'll see something simlar to:
30+
31+
![Failing Test](https://dl.dropboxusercontent.com/s/0ik01a1urmuw7o6/2015-09-30%20at%207.46%20PM.png)
32+
33+
*Note: My prompt is `// ♥`, yours might be different. You'll see a terminal prompt generally represented by a `$`. That indicates you're suppose to be typing in terminal.*
34+
35+
You can see your test is currently failing, which is fine, we haven't done any work yet, so it makes sense.
36+
37+
The failure reads: `Make sure you have added a new file or edited edit-me.txt`
38+
39+
4. To pass this lab, either make any change to the content of `edit-me.txt` or create a new file.
40+
41+
You can open `edit-me.txt` and you'll see it is currently empty. Add anything to that file, save the file, and then run `learn`, everything should pass.
42+
43+
You can also pass this lab by creating a new file. From Terminal, you can run `touch new-file` to create a new file. Or use your text editor to create a new file and save it. If a new file is added to this lab, when you run `learn`, your tests should pass.
44+
45+
![Passing Tests](https://dl.dropboxusercontent.com/s/op46jyoc228ji62/2015-09-30%20at%207.53%20PM.png)
46+
47+
5. Once your local tests are passing, you can submit this lab by running `learn submit` from your terminal.
48+
49+
50+
351
## Outline
452

553
Very much based on https://github.com/learn-co-curriculum/first-lab
File renamed without changes.

new-file

Whitespace-only changes.
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
require 'pry'
2+
require 'spec_helper'
3+
4+
describe 'First Lab:' do
5+
it 'you made a change' do
6+
new_file_made = Dir["*"].size > 5
7+
file_edited = !File.read("./edit-me.txt").empty?
8+
expect((new_file_made || file_edited)).to be_truthy, "Make sure you have added a new file or edited edit-me.txt"
9+
end
10+
end

spec/spec_helper.rb

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

0 commit comments

Comments
 (0)