Skip to content

Instantly share code, notes, and snippets.

View rhysforyou's full-sized avatar

Rhys Powell rhysforyou

View GitHub Profile
// In AppDelegate.m
- (void)application:(UIApplication *)application
willChangeStatusBarOrientation:(UIInterfaceOrientation)newStatusBarOrientation duration:(NSTimeInterval)duration
{
// Do some stuff with the orientation
// UIOrientation is an enumerable defined as
//
// typedef enum {
// UIInterfaceOrientationPortrait = UIDeviceOrientationPortrait,
class Post < ActiveRecord::Base
validates :content, :presence => true,
:length => {:minimum => 140}
after_initialize do
self.publish_date ||= DateTime.now
end
def published?
rails g controller PostsAdmin
create app/controllers/posts_admin_controller.rb
invoke erb
create app/views/posts_admin
invoke rspec
create spec/controllers/posts_admin_controller_spec.rb
invoke helper
create app/helpers/posts_admin_helper.rb
invoke rspec
create spec/helpers/posts_admin_helper_spec.rb
/Users/rpowell93/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -rrubygems -S /Users/rpowell93/.rvm/gems/[email protected]/gems/rspec-core-2.6.4/bin/rspec --tty '/Users/rpowell93/Projects/rpowell.me/spec/models/post_spec.rb'
......F
Failures:
1) Post should only return published posts in the 'published' scope
Failure/Error: Post.published.count.should == 2
expected: 2
got: 1 (using ==)
# ./spec/models/post_spec.rb:52:in `block (2 levels) in <top (required)>'
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="60">
<path
transform="scale(0.05)"
style="fill:#404040;fill-opacity:1;stroke:none"
d="m 319.23299,641.96561 c -49.05933,35.49729 -71.45137,93.32016 -62.35725,146.58563 -93.96807,80.2322 -150.48671,149.43663 -134.88762,170.99549 15.59114,21.548 98.8548,-10.5467 204.34222,-74.68731 47.75933,25.24955 109.73244,21.83849 158.77597,-13.64734 49.04347,-35.48584 71.66456,-93.28366 62.6175,-146.54387 93.9129,-80.13725 150.43708,-149.18736 134.84587,-170.73524 -15.11848,-20.89465 -94.02706,8.59909 -194.99501,68.84445 8.23021,4.76564 15.9772,10.39865 23.20249,16.8037 40.87148,-19.91216 70.16551,-27.36043 77.40583,-17.35379 13.8699,19.16893 -58.1683,94.7771 -160.88106,169.09582 -102.71276,74.31873 -197.05723,119.09821 -210.92713,99.92928 -7.77293,-10.74271 11.42469,-39.28045 47.86241,-75.35592 4.0177,10.07213 9.44873,19.73644 16.06029,28.87398 5.01439,6.93021 10.58357,13.13114 16.60555,18.81598 33.96549,-15.2713 79.45122,-42.30217 127.12077,-76.79388 47.
/Users/rpowell93/.rvm/gems/[email protected]/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:470:in `assert_no_example_groups_defined': RSpec's mock_framework configuration option must be configured before any example groups are defined, but you have already defined a group. (RSpec::Core::Configuration::MustBeConfiguredBeforeExampleGroupsError)
from /Users/rpowell93/.rvm/gems/[email protected]/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:168:in `mock_framework='
from /Users/rpowell93/.rvm/gems/[email protected]/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:142:in `mock_with'
from /Users/rpowell93/repositories/hackety-hack.com/spec/spec_helper.rb:18:in `block in <top (required)>'
from /Users/rpowell93/.rvm/gems/[email protected]/gems/rspec-core-2.7.1/lib/rspec/core.rb:71:in `configure'
from /Users/rpowell93/repositories/hackety-hack.com/spec/spec_helper.rb:10:in `<top (required)>'
from /Users/rpowell93/repositories/hackety
require 'spec_helper'
describe "books/new.html.erb" do
it "should have a link back to the index"
end
source 'http://rubygems.org'
gem 'rails', '3.1.3'
gem 'sqlite3'
gem 'jquery-rails'
gem 'nifty-generators', :group => :development
gem 'devise'
group :assets do
gem 'sass-rails', '~> 3.1.5'
function(r,g,b){return "R0lGODlhEAAQAIAA"+btoa(String.fromCharCode(0,r,g,b,0,0))+"ACH5BAQAAAAALAAAAAAQABAAAAIOhI+py+0Po5y02ouzPgUAOw=="}
Feature: Book list
The main purpose of this app is to help a user manage a book list. This
consists of books they'd like to read, books they're reading and books
they've read.
Background:
Given I am logged in
Scenario: Add a book to the book list