> Use the described class:
>
> shared_examples "a nameable thingie" do |klass|
> describe "#build_name" do
> it "it adds the collection of arguments to the base components and
> formats them for a form element name attribute" do
> described_class.new(nil,nil).build_name(:lol, :lollers
On Nov 8, 2011, at 12:52 AM, Romain Tribes wrote:
> Hello,
>
> I'm writing a Risk-like webgame
> (https://github.com/Sephi-Chan/Conquest-on-Rails) and I want to add tests,
> but it's painful since objects have a lot of dependencies each other.
>
> For instance, I have moved the attack logic in
On Nov 8, 2011, at 10:52 AM, Stephen Kessler wrote:
> Hi all,
>
> I have a bug in my code that I have been unable to track down that
> deals with the set_fixture_class statement. Basically,
> set_fixture_class (and my tests) are working fine when I test one
> controller in isolation, but they ar
On Nov 11, 2011, at 6:48 AM, Ervin wrote:
> Given that I assume that rails helper image_tag works as intended, I
> want to mock out call to this method in my helper.
>
> spec/helpers/some_helper_spec.rb:
> require 'spec_helper'
> describe SomeHelper do
> it 'allows stub tags' do
>help
On Nov 8, 2011, at 4:40 PM, ipoval wrote:
> Hi,
>
> I wanted to ask if there are plans to introduce Rspec.configure { |
> conf| conf.simplecov = true } option?
> I understand that it is easy to add "require 'simplecov';
> SimpleCov.start" into the spec_helper.rb, but it just doesn't look
> nice t
On Nov 14, 2011, at 6:57 PM, Patrick J. Collins wrote:
> So, I recognize that there are many different ways to accomplish what I am
> trying to do, but none of them seem to be as elegant as I would like.
>
> I have a few classes which need to have shared functionality...
>
> So I could do someth
On Nov 8, 2011, at 10:45 AM, Thibaut Barrère wrote:
> Hello,
>
> I'm a bit puzzled on this one.
>
> I'm getting a wrong number of arguments on a reduce call (full stack trace
> here: https://gist.github.com/1348309).
>
> Any idea where it could come from? (I tried with 2.7.1 and 2.8.0.rc1).
>
On Nov 8, 2011, at 12:53 AM, emadridm wrote:
> Hi guys,
>
> I don't know how to write an spec for a view template with two or more
> forms. The follow content corresponds to the file named home.html.haml
>
> !!! 5
> = form_for(:session, :url => sessions_path) do |f|
> .field
>= f.label :ema
> Having trouble following your example. Why do you have to pass
> Bar.new(nil, nil) for this test?
Because the shared example is testing the method #build_name from the module
that is included in the various classes-- it needs the object that #build_name
is attached to in order to test the funct
Quoting Patrick J. Collins :
> describe Bar do
> it_behaves_like "a nameable thingie", Bar.new(nil, nil)
> end
>
> Which I don't like, mainly because Foo & Bar's initialize methods require
> arguments, and I am having to do (nil, nil) which seems very uncool...
Having trouble following your exa
So, I recognize that there are many different ways to accomplish what I am
trying to do, but none of them seem to be as elegant as I would like.
I have a few classes which need to have shared functionality...
So I could do something like this:
module NameBuilder
def build_name(*args)
args
Quoting JDeville :
> The setup for certain integration specs is a bit slow, and I'm generally
> careful to make my 'it' blocks read-only. However, I also like to keep my
> it blocks extremely focused on just 1 thing. This has become a performance
> problem though, because the setup is executed
Hi,
I wanted to ask if there are plans to introduce Rspec.configure { |
conf| conf.simplecov = true } option?
I understand that it is easy to add "require 'simplecov';
SimpleCov.start" into the spec_helper.rb, but it just doesn't look
nice there.
--
Thanks!
___
I am attempting to test a custom method, and totally bombing out.
describe Record do
describe '#save_cf_data' do
before :each do
@record = mock_model(Record)
end
it "should have a birthday" do
@record.save_cf_data({"final_outputs"=>["birth_day"=>["3"]]})
@record.bir
Hello,
I'm a bit puzzled on this one.
I'm getting a wrong number of arguments on a reduce call (full stack trace
here: https://gist.github.com/1348309).
Any idea where it could come from? (I tried with 2.7.1 and 2.8.0.rc1).
FWIW, it's a Rails 2.3/RSpec 1 app that I'm migrating to Rails 3.0/RSp
Given that I assume that rails helper image_tag works as intended, I
want to mock out call to this method in my helper.
spec/helpers/some_helper_spec.rb:
require 'spec_helper'
describe SomeHelper do
it 'allows stub tags' do
helper.should_receive(:image_tag).with(2).and_return(3)
Hi all,
I have a bug in my code that I have been unable to track down that
deals with the set_fixture_class statement. Basically,
set_fixture_class (and my tests) are working fine when I test one
controller in isolation, but they are failing when I run all my
controller specs together.
My projec
Hello,
I'm writing a Risk-like webgame
(https://github.com/Sephi-Chan/Conquest-on-Rails) and I want to add tests,
but it's painful since objects have a lot of dependencies each other.
For instance, I have moved the attack logic in a dedicated class
(https://github.com/Sephi-Chan/Conquest-on-Ra
The setup for certain integration specs is a bit slow, and I'm generally
careful to make my 'it' blocks read-only. However, I also like to keep my
it blocks extremely focused on just 1 thing. This has become a performance
problem though, because the setup is executed for every 'it'. Is there
Hi guys,
I don't know how to write an spec for a view template with two or more
forms. The follow content corresponds to the file named home.html.haml
!!! 5
= form_for(:session, :url => sessions_path) do |f|
.field
= f.label :email
= f.text_field :email
.field
= f.label :password
20 matches
Mail list logo