Skip to content

Commit

Permalink
Include Gaskit into specs so we don't have to namespace everything
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeepers committed Sep 1, 2011
1 parent 4f00ee5 commit e5e70bd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
6 changes: 3 additions & 3 deletions spec/gaskit/app_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper'

describe Gaskit::App do
describe App do
include Rack::Test::Methods

def app
Expand Down Expand Up @@ -46,7 +46,7 @@ def app

it 'should create a story' do
subject
Gaskit::Story.count.should == 1
Story.count.should == 1
end

it 'should render json' do
Expand Down Expand Up @@ -95,7 +95,7 @@ def app

it 'should destroy the story' do
subject
Gaskit::Story.key?(@story.id).should be_false
Story.key?(@story.id).should be_false
end
end
end
20 changes: 10 additions & 10 deletions spec/gaskit/story_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require 'spec_helper'

describe Gaskit::Story do
describe Story do
describe 'lifecycle' do
subject { Gaskit::Story.create!(:description => 'Solve world hunger')}
subject { Story.create!(:description => 'Solve world hunger')}

it 'should be creatable' do
Gaskit::Story.get(subject.id).should == subject
Story.get(subject.id).should == subject
end

it 'should be updateable' do
Expand All @@ -16,27 +16,27 @@

it 'should be destroyable' do
subject.destroy
Gaskit::Story.get(subject.id).should be_nil
Story.get(subject.id).should be_nil
end
end

describe '.count' do
it 'should return the correct count for stories' do
Gaskit::Story.count.should == 0
Story.count.should == 0
story = create(:story)
Gaskit::Story.count.should == 1
Story.count.should == 1
story.destroy
Gaskit::Story.count.should == 0
Story.count.should == 0
end
end

describe '.all' do
it 'should all stories' do
Gaskit::Story.all.should == []
Story.all.should == []
story = create(:story)
Gaskit::Story.all.should == [story]
Story.all.should == [story]
story.destroy
Gaskit::Story.all.should == []
Story.all.should == []
end
end
end
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
Gaskit.repo.git.fs_delete("refs/heads/gaskit")
end
end

include Gaskit # so we don't have to namespace EVERYTHING

0 comments on commit e5e70bd

Please sign in to comment.