Hack hack hack...

An open journal-- some of it written for you, but most of it is for me.

FIS Day14

POTD DHH

  • DHH- you know who he is.

Stubs:

A method stub is an implementation that returns a pre-determined value. Method stubs can be declared on test doubles or real objects using the same syntax. rspec-mocks supports 3 forms for declaring method stubs:

RSpec Hooks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require "rspec/expectations"

describe "before and after callbacks" do
  before(:all) do
    puts "before all"
  end

  before(:each) do
    puts "before each"
  end

  after(:each) do
    puts "after each"
  end

  after(:all) do
    puts "after all"
  end

  it "gets run in order" do

  end
end

Git Error

RSpec Hooks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
You asked me to pull without telling me which branch you
want to rebase against, and 'branch.master.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.

If you often rebase against the same branch, you may want to
use something like the following in your configuration file:

    [branch "master"]
    remote = <nickname>
    merge = <remote-ref>
    rebase = true

    [remote "<nickname>"]
    url = <url>
    fetch = <refspec>

Rails Lecture

  • as a client you identify your attributes to a webserver in your headers.

    • In theory, you don’t need anything in the header.
  • a request must have a url and a method

  • a response has it’s own headers
    • shows the kind of content type
    • displays the body and the content (like the HTML)
  • hypertext transfer protocol (http)

HTTP verbs:

  • get: retrieve
  • post: submits data- appropriate if you are submitting entirely new data
  • put: update
  • delete: delete this resource
  • head: asks for response like a GET but without the body
  • trace, options, connect, patch: we don’t care about

  • HTTP is all about applying verbs to nouns.

Convention over configuration

  • Naming Scheme:
    • table: songs
    • model: song.rb
    • controller: songs_controller.rb
    • views: songs/

Comments