Permalink
Browse files

Trying to get the spec to recognize the factory. Not working thus far.

  • Loading branch information...
aantix committed Nov 16, 2010
1 parent 49bee13 commit 74b30361d96e5378a885887825a29d10188749c1
Showing with 90 additions and 48 deletions.
  1. +13 −1 .idea/sex_it_up.iml
  2. +33 −37 .idea/workspace.xml
  3. +3 −1 Gemfile
  4. +23 −1 Gemfile.lock
  5. +2 −1 lib/sex_it_up.rb
  6. +1 −1 spec/factories/sex_it_up_image_factory.rb
  7. +4 −1 spec/sex_it_up_spec.rb
  8. +11 −5 spec/spec_helper.rb
View
@@ -1,6 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="RUBY_MODULE" version="4">
<component name="GemRequirementsHolder" version="3">
+ <requirement>
+ <requirement>
+ <dependency name="actionpack" version="3.0.1" bound="GREATER_OR_EQUAL" git="false" path="false" doRequire="true" />
+ </requirement>
+ <source from="Gemfile" />
+ </requirement>
+ <requirement>
+ <requirement>
+ <dependency name="activerecord" version="3.0.1" bound="GREATER_OR_EQUAL" git="false" path="false" doRequire="true" />
+ </requirement>
+ <source from="Gemfile" />
+ </requirement>
<requirement>
<requirement>
<dependency name="bundler" version="1.0.0" bound="LATEST_IN_BRANCH" git="false" path="false" doRequire="true" />
@@ -39,7 +51,7 @@
</requirement>
<requirement>
<requirement>
- <dependency name="rspec" version="2.1.0" bound="LATEST_IN_BRANCH" git="false" path="false" doRequire="true" />
+ <dependency name="rspec-rails" version="2.1.0" bound="LATEST_IN_BRANCH" git="false" path="false" doRequire="true" />
</requirement>
<source from="Gemfile" />
</requirement>
View
@@ -2,18 +2,14 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="14caa7ed-9d0d-4a7a-b994-4ab069add87d" name="Default" comment="">
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/Gemfile" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/VERSION" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/autotest/discover.rb" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/factories/sex_it_up_image_factory.rb" />
- <change type="DELETED" beforePath="$PROJECT_DIR$/spec/spec.opts" afterPath="" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/.rakeTasks" afterPath="$PROJECT_DIR$/.idea/.rakeTasks" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/sex_it_up.iml" afterPath="$PROJECT_DIR$/.idea/sex_it_up.iml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Gemfile.lock" afterPath="$PROJECT_DIR$/Gemfile.lock" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Rakefile" afterPath="$PROJECT_DIR$/Rakefile" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/generators/sex_it_up/templates/sex_it_up_migration.rb.erb" afterPath="$PROJECT_DIR$/generators/sex_it_up/templates/sex_it_up_migration.rb.erb" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Gemfile" afterPath="$PROJECT_DIR$/Gemfile" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/sex_it_up.rb" afterPath="$PROJECT_DIR$/lib/sex_it_up.rb" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/spec/factories/sex_it_up_image_factory.rb" afterPath="$PROJECT_DIR$/spec/factories/sex_it_up_image_factory.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/spec/sex_it_up_spec.rb" afterPath="$PROJECT_DIR$/spec/sex_it_up_spec.rb" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/spec/spec_helper.rb" afterPath="$PROJECT_DIR$/spec/spec_helper.rb" />
</list>
<ignored path="sex_it_up.iws" />
<ignored path=".idea/workspace.xml" />
@@ -37,10 +33,10 @@
<component name="FileColors" enabled="true" enabledForTabs="true" showNonProject="false" />
<component name="FileEditorManager">
<leaf>
- <file leaf-file-name="spec_helper.rb" pinned="false" current="false" current-in-tab="false">
+ <file leaf-file-name="spec_helper.rb" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="9" column="0" selection-start="211" selection-end="211" vertical-scroll-proportion="-6.6666665">
+ <state line="10" column="54" selection-start="371" selection-end="371" vertical-scroll-proportion="0.3021148">
<folding />
</state>
</provider>
@@ -49,7 +45,7 @@
<file leaf-file-name="Rakefile" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Rakefile">
<provider selected="true" editor-type-id="text-editor">
- <state line="20" column="72" selection-start="742" selection-end="742" vertical-scroll-proportion="-10.37037">
+ <state line="12" column="58" selection-start="290" selection-end="290" vertical-scroll-proportion="-8.444445">
<folding />
</state>
</provider>
@@ -58,7 +54,7 @@
<file leaf-file-name="sex_it_up_spec.rb" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/spec/sex_it_up_spec.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="20" column="59" selection-start="779" selection-end="779" vertical-scroll-proportion="-14.814815">
+ <state line="6" column="16" selection-start="228" selection-end="228" vertical-scroll-proportion="-4.4444447">
<folding />
</state>
</provider>
@@ -67,7 +63,7 @@
<file leaf-file-name="sex_it_up_image_factory.rb" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/spec/factories/sex_it_up_image_factory.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="31" selection-start="16" selection-end="31" vertical-scroll-proportion="-0.0">
+ <state line="1" column="0" selection-start="39" selection-end="39" vertical-scroll-proportion="-0.7407407">
<folding />
</state>
</provider>
@@ -82,10 +78,10 @@
</provider>
</entry>
</file>
- <file leaf-file-name="sex_it_up.rb" pinned="false" current="true" current-in-tab="true">
+ <file leaf-file-name="sex_it_up.rb" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/sex_it_up.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="2" column="18" selection-start="54" selection-end="54" vertical-scroll-proportion="0.06163328">
+ <state line="3" column="20" selection-start="83" selection-end="83" vertical-scroll-proportion="-2.2222223">
<folding />
</state>
</provider>
@@ -94,7 +90,7 @@
<file leaf-file-name="Gemfile" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Gemfile">
<provider selected="true" editor-type-id="text-editor">
- <state line="9" column="0" selection-start="232" selection-end="232" vertical-scroll-proportion="-6.6666665">
+ <state line="8" column="18" selection-start="228" selection-end="228" vertical-scroll-proportion="-5.9259257">
<folding />
</state>
</provider>
@@ -103,7 +99,7 @@
<file leaf-file-name="README.rdoc" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/README.rdoc">
<provider selected="true" editor-type-id="text-editor">
- <state line="13" column="0" selection-start="642" selection-end="642" vertical-scroll-proportion="0.0">
+ <state line="13" column="0" selection-start="642" selection-end="642" vertical-scroll-proportion="-9.62963">
<folding />
</state>
</provider>
@@ -149,15 +145,15 @@
<option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/build.sh" />
<option value="$PROJECT_DIR$/VERSION" />
- <option value="$PROJECT_DIR$/spec/spec_helper.rb" />
<option value="$PROJECT_DIR$/autotest/discover.rb" />
<option value="$PROJECT_DIR$/generators/sex_it_up/templates/sex_it_up_migration.rb.erb" />
<option value="$PROJECT_DIR$/spec/factories/sex_it_up_images_factory.rb" />
- <option value="$PROJECT_DIR$/spec/factories/sex_it_up_image_factory.rb" />
- <option value="$PROJECT_DIR$/spec/sex_it_up_spec.rb" />
- <option value="$PROJECT_DIR$/Gemfile" />
<option value="$PROJECT_DIR$/Rakefile" />
<option value="$PROJECT_DIR$/lib/sex_it_up.rb" />
+ <option value="$PROJECT_DIR$/Gemfile" />
+ <option value="$PROJECT_DIR$/spec/spec_helper.rb" />
+ <option value="$PROJECT_DIR$/spec/factories/sex_it_up_image_factory.rb" />
+ <option value="$PROJECT_DIR$/spec/sex_it_up_spec.rb" />
</list>
</option>
</component>
@@ -503,65 +499,65 @@
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/README.rdoc">
+ <entry file="file://$PROJECT_DIR$/generators/sex_it_up/sex_it_up_generator.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="13" column="0" selection-start="642" selection-end="642" vertical-scroll-proportion="0.0">
+ <state line="5" column="45" selection-start="224" selection-end="224" vertical-scroll-proportion="0.147929">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/generators/sex_it_up/sex_it_up_generator.rb">
+ <entry file="file://$PROJECT_DIR$/README.rdoc">
<provider selected="true" editor-type-id="text-editor">
- <state line="5" column="45" selection-start="224" selection-end="224" vertical-scroll-proportion="0.147929">
+ <state line="13" column="0" selection-start="642" selection-end="642" vertical-scroll-proportion="-9.62963">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Gemfile">
<provider selected="true" editor-type-id="text-editor">
- <state line="9" column="0" selection-start="232" selection-end="232" vertical-scroll-proportion="-6.6666665">
+ <state line="8" column="18" selection-start="228" selection-end="228" vertical-scroll-proportion="-5.9259257">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
+ <entry file="file://$PROJECT_DIR$/lib/sex_it_up.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="9" column="0" selection-start="211" selection-end="211" vertical-scroll-proportion="-6.6666665">
+ <state line="3" column="20" selection-start="83" selection-end="83" vertical-scroll-proportion="-2.2222223">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/Rakefile">
+ <entry file="file://$PROJECT_DIR$/generators/sex_it_up/templates/sex_it_up_migration.rb.erb">
<provider selected="true" editor-type-id="text-editor">
- <state line="20" column="72" selection-start="742" selection-end="742" vertical-scroll-proportion="-10.37037">
+ <state line="4" column="35" selection-start="122" selection-end="139" vertical-scroll-proportion="-2.9629629">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/spec/sex_it_up_spec.rb">
+ <entry file="file://$PROJECT_DIR$/Rakefile">
<provider selected="true" editor-type-id="text-editor">
- <state line="20" column="59" selection-start="779" selection-end="779" vertical-scroll-proportion="-14.814815">
+ <state line="12" column="58" selection-start="290" selection-end="290" vertical-scroll-proportion="-8.444445">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/spec/factories/sex_it_up_image_factory.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="31" selection-start="16" selection-end="31" vertical-scroll-proportion="0.0">
+ <state line="1" column="0" selection-start="39" selection-end="39" vertical-scroll-proportion="-0.7407407">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/generators/sex_it_up/templates/sex_it_up_migration.rb.erb">
+ <entry file="file://$PROJECT_DIR$/spec/sex_it_up_spec.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="4" column="35" selection-start="122" selection-end="139" vertical-scroll-proportion="-2.9629629">
+ <state line="6" column="16" selection-start="228" selection-end="228" vertical-scroll-proportion="-4.4444447">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/lib/sex_it_up.rb">
+ <entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
<provider selected="true" editor-type-id="text-editor">
- <state line="2" column="18" selection-start="54" selection-end="54" vertical-scroll-proportion="0.06163328">
+ <state line="10" column="54" selection-start="371" selection-end="371" vertical-scroll-proportion="0.3021148">
<folding />
</state>
</provider>
View
@@ -1,10 +1,12 @@
+gem "activerecord", ">= 3.0.1"
+gem "actionpack", ">= 3.0.1"
gem "paperclip", ">= 2.3.5"
gem "mechanize", ">= 1.0.0"
gem "google-search", ">= 1.0.2"
group :test, :development do
gem 'factory_girl', '= 1.3.2'
- gem "rspec", "~> 2.1.0"
+ gem "rspec-rails", "~> 2.1.0"
gem "bundler", "~> 1.0.0"
gem "jeweler", "~> 1.5.1"
end
View
@@ -1,5 +1,16 @@
GEM
specs:
+ abstract (1.0.0)
+ actionpack (3.0.1)
+ activemodel (= 3.0.1)
+ activesupport (= 3.0.1)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.4.1)
+ rack (~> 1.2.1)
+ rack-mount (~> 0.6.12)
+ rack-test (~> 0.5.4)
+ tzinfo (~> 0.3.23)
activemodel (3.0.1)
activesupport (= 3.0.1)
builder (~> 2.1.2)
@@ -14,6 +25,8 @@ GEM
activesupport (~> 3.0.0)
builder (2.1.2)
diff-lcs (1.1.2)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
factory_girl (1.3.2)
git (1.2.5)
google-search (1.0.2)
@@ -30,6 +43,11 @@ GEM
paperclip (2.3.5)
activerecord
activesupport
+ rack (1.2.1)
+ rack-mount (0.6.13)
+ rack (>= 1.0.0)
+ rack-test (0.5.6)
+ rack (>= 1.0)
rake (0.8.7)
rspec (2.1.0)
rspec-core (~> 2.1.0)
@@ -39,16 +57,20 @@ GEM
rspec-expectations (2.1.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.1.0)
+ rspec-rails (2.1.0)
+ rspec (~> 2.1.0)
tzinfo (0.3.23)
PLATFORMS
ruby
DEPENDENCIES
+ actionpack (>= 3.0.1)
+ activerecord (>= 3.0.1)
bundler (~> 1.0.0)
factory_girl (= 1.3.2)
google-search (>= 1.0.2)
jeweler (~> 1.5.1)
mechanize (>= 1.0.0)
paperclip (>= 2.3.5)
- rspec (~> 2.1.0)
+ rspec-rails (~> 2.1.0)
View
@@ -1,6 +1,7 @@
require 'rubygems'
require 'paperclip'
-require 'rails'
+require 'active_record'
+require 'action_view'
module SexItUp
@@ -1,5 +1,5 @@
Factory.define :sex_it_up_image do |i|
- i.image File.new(Rails.root + 'spec/factories/Plato_and_Aristotle_in_The_School_of_Athens,_by_italian_Rafael.jpg')
+ i.image File.new('spec/factories/Plato_and_Aristotle_in_The_School_of_Athens,_by_italian_Rafael.jpg')
i.image_original_url 'http://upload.wikimedia.org/wikipedia/commons/f/ff/Plato_and_Aristotle_in_The_School_of_Athens%2C_by_italian_Rafael.jpg'
i.image_search_term 'school'
end
View
@@ -1,4 +1,7 @@
-require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+#require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+ROOT_DIR = `pwd`.strip unless defined? ROOT_DIR
+puts "ROOT = #{ROOT_DIR}"
+require ROOT_DIR + '/spec/spec_helper'
describe SexItUp::SexItUpImage, '#find_all' do
View
@@ -1,9 +1,15 @@
-$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+require 'rspec'
require 'sex_it_up'
-require 'spec'
-require 'spec/autorun'
+require 'factory_girl'
+
+# Requires supporting files with custom matchers and macros, etc,
+# in ./support/ and its subdirectories.
+Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
+
+Factory.find_definitions
-Spec::Runner.configure do |config|
-
+RSpec.configure do |config|
+ config.mock_with :rspec
end

0 comments on commit 74b3036

Please sign in to comment.