Displaying 20 results from an estimated 10000 matches similar to: "rspec_plugin generator"
2007 Jan 19
3
Something cool I learned about rspec today
I found an awesome feature today. When you''re setting expectations,
you can actually pattern match the parameters to methods. Here''s my
discussion and example:
http://evang.eli.st/blog/2007/1/19/parameter-matching-in-rspec
Pat
2007 Apr 09
7
RCov results seem to include the spec files
I saw the RCov page at http://rspec.rubyforge.org/tools/rcov.html and
decided to add it to my project. My rakefile looks like this:
require "rake"
require "spec/rake/spectask"
desc "Run all specs with RCov"
Spec::Rake::SpecTask.new("spec:rcov") do |t|
t.spec_files = FileList["spec/**/*_spec.rb"]
t.rcov = true
end
When I run rake spec:rcov,
2007 Apr 25
9
Running specs for a plugin - undefined method ''define'' for object
I''m trying to write specs for a plugin I''m developing named audit_fu, and
I''m running into a problem which I can''t get past it. I''ve got the same
specs setup in the main rails app, and everything works fine there, it''s
just running the plugin specs that I''m having a problem with. My setup is:
- edge rails
- edge rspec (in
2006 Dec 20
16
Edge RSpec on Rails...what did I forget?
Started a new Rails project, and installed RSpec and the Rails plugin
vendor/plugins/rspec (svn://rubyforge.org/var/svn/rspec/trunk/rspec) - 1332
vendor/plugins/rspec_on_rails
(svn://rubyforge.org/var/svn/rspec/trunk/rspec_on_rails/vendor/plugins/rspec_on_rails)
- 1332
Generated the rspec file, created a model...the spec runs fine if I do
ruby spec/models/foo_spec.rb. Running rake though gives
2008 Mar 03
2
Testing Plugins + Lib Code
Hi,
I''m quite new to Rspec and I''m embarking on a new project. One thing I''m
really not sure about is how to test plugins and code in your ''lib/''
folder. Where would these specs actually live in the dir structure?
Should you test plugins by creating specs within the plugin''s dir? Or by
adding a spec to the main ''/specs''
2007 Aug 03
2
Plugins ''speced'' with rSpec?
Hello,
I''m trying to figure out how to setup a spec structure for plugins. I''m
getting pretty lost in figuring out how to isolate a plugin enviornment
emulating rails, but not actually being reflected upon the current rails
project.
What I mean is this, let''s say I have a comment plugin. This has two things
in lib, the comment model (comment.rb) and then the module
2007 Sep 03
6
blog post on story runner
Here''s an excellent blog post on Story Runner, which will be part of
the next release and is undergoing active development in trunk:
http://evang.eli.st/blog/2007/9/1/user-stories-with-rspec-s-story-runner
2007 Mar 13
1
Opening the singleton class of mocked objects
I wrote a plugin [1] a while ago that lets me do validations on a
single AR instance. Instead of defining validations in an AR class, I
can define them on a AR instance''s singleton class:
class << @video
validates_presence_of :title
end
One of my specs mocks Video.find, and the above code is run on the
mock object. When I run the spec, I get the expected
undefined method
2006 Dec 24
6
What do you think of this controller spec?
Here''s a controller spec I wrote, it''s for a very simple RESTful
controller (well, aren''t all RESTful controllers simple? :)
I''ve created a couple spec helper methods to refactor some of the
common code...for example, require_login_and_correct_user creates two
specifications: one for when the user isn''t logged in, and one when
the user is logged in but
2007 Nov 26
0
rSpec (rev 2996), Rails (rev 8214): TextMate bundle problems
Hey guys,
I''m trying to get rSpec (rev 2996) working with Rails 2 (rev 8214).
Running the tests from the command line works, no problem.
I installed the RSpec.tmbundle (also rev 2996), and would like to see
the HTML test results in TextMate. When I run the "Run examples in
selected files/directories" command in TextMate, I get the following
dump:
2008 Mar 10
10
tutes on testing controllers
hello spec''ers,
i''m in the hunt for guides on testing controllers with rspec, would
you guys recommend any?
thanks
Oliver
--
Oliver Azevedo Barnes
oli.azevedo.barnes at gmail.com
+55 11 9768 0193
http://www.linkedin.com/in/oliverbarnes
http://workingwithrails.com/person/4704-oliver-barnes
2006 Nov 03
10
[PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
rspec_resource_generator
========================
By Pat Maddox
Use this generator to generate RESTful scaffolding with RSpec specifications.
Syntax is exactly the same as the scaffold_resource generator:
./script/generate rspec_resource ModelName [field:type field:type]
When you run this generator, it will create a migration, model, and
model spec file. In addition, it gives you a RESTful
2013 Jun 18
1
Getting rspec error: Net::SMTPServerBusy: Relay access denied
I''m trying to test registration emails (sent with devise), and I keep
getting the error:
Net::SMTPServerBusy: 454 4.7.1 <model_spec-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org>: Relay access denied
I''m running Rails 3.2.11 with Capybara, and I have (temporarily) chopped my
spec_helper.rb and test.rb files down to the bare minimum, still getting
the error above.
2011 Sep 01
2
How to remove this deprecation warning
Hi,
After upgrading to rails 3.1 and rspec-rails 2.6.1 I get the following
deprecation warning, however as far as I can tell I am not defining any
examples before it is called.
I am using the default spec_helper generated with rails g rspec:install so
why this warning?
Thanks
*****************************************************************
DEPRECATION WARNING: you are using deprecated
2008 Jan 21
3
Story runner "macros"
I''ve gotten quite a bit out of Pat Maddox''s screencast
http://evang.eli.st/blog/2007/10/8/story-runner-top-to-bottom-screencast
One thing I''m not sure of is the feature where he writes things like:
When "I POST to", "/articles", :post => {:title => "Title", :body
=> "Body") do | path, params|
post_via_redirect
2011 Aug 10
1
How to stop Rspec loading my Cucumber fixtures
I have a bunch of fixtures designed to populate the database for my Cucumber
integration tests.
But at this stage I want my database to be empty when using Rspec.
So, I moved the fixtures from `/spec/fixtures` to
`features/support/fixtures`, and updated `features/support/env.rb` to read:
Fixtures.reset_cache
fixtures_folder = File.join(RAILS_ROOT, ''features'',
2007 Sep 04
7
Rake tasks getting in the way of edge (uses gem instead)
So I''d been running gem releases of rspec for the past several months,
and I installed edge rspec so that I can use Story Runner.
I''m running into a problem because I''ve got a couple rake tasks that
reference "spec/rake/raketask". If I try to run "rake spec" then it
pulls in the gem version instead of the plugin version. rake blows up
saying that
2007 Mar 14
5
What''s the new syntax for predicates?
@settings.should allow_publish_ip("127.0.0.1") fails with
undefined method `allow_publish_ip'' for #<#<Class:0x2f8fd48>:0x2f5a968>
@settings.should_allow_publish_ip("127.0.0.1") works fine
This is rspec 0.8.2.
http://rspec.rubyforge.org/documentation/expectations.html says that
matching arbitrary predicates is deprecated and to see
2007 Sep 15
3
How to write a plugin that uses rspec internally?
My team is working on a plugin and we want to use RSpec internally for the
plugin''s tests.
(a) What are some different ways to go about this? Should we rely on the
RSpec gem? Should we expect that the "host" Rails application has installed
the RSpec plugins? Are there other options?
(b) Which approach from (a) would you recommend?
(c) Would you recommend any particular
2013 Mar 20
2
Rspec + Devise + BaseController
Hello there,
I''m creating a base controller for the admin section of a project. All
controllers whitin the admin section will inherit from it.
#####################################################
#app/controllers/admins/base_controller.rb
class Admins::BaseController < ApplicationController
layout "admin_cms"
before_filter :authenticate_admin!
end