similar to: spec-ing private methods?

Displaying 20 results from an estimated 1000 matches similar to: "spec-ing private methods?"

2011 Feb 09
16
rails 3.0.4 broke yield :javascript ?
hello, I have today updated my rails app to 3.0.4 security release but now this yield :javascripts fails in the layout and I get my custom js escaped as text in the view. anybody seeing this also? tia, jk -- www.least-significant-bit.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to
2009 Apr 16
6
Cucumber - step negating another expecting step
On 16 Apr 2009, at 11:22, Joaquin Rivera Padron wrote: > at the moment I do it this way, hiding the complexity out of the > steps: > > Then /^I should see the people search form$/ do > people_search_form_exists > end > > Then /^I should not see the people search form$/ do > people_search_form_exists "not" > end > > and then the method: > >
2008 Nov 04
18
Can I do foo.should (be_nil || be_empty) in rspec
Is there any way to do foo.should (be_nil || be_empty) in rspec. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081104/ee43c9c9/attachment.html>
2008 Dec 02
11
Any plans for Before-feature or Before-all steps in Cucumber?
Hi The code I''m working on now is a server daemon that talks to Twitter, an RSS feed, and some web pages. I''ve got mock implementations of Twitter and the web stuff, which I start and stop with daemon_controller[1]. I do all the setup in a Before block, but this makes the feature runs agonisingly slow due to the time waiting for everything to restart. I''m
2008 May 27
8
new --pattern option
Hello. You''re saying that: To get rspec to behave as it did before this change, use this: --pattern "**/*.rb" I tried like this (rspec 1.03) and it wasn''t same as before (rspec 1.08). Now it also loads all other files in current directory and in all subdirectories and not only from directory and subdirectories given to spec as a parameter. So, for example, I have
2007 Dec 05
4
render :update and controller private methods
Probably asked and answered, but... Why are controller private methods inaccessible inside the block passed to render :update ? This does not work: class MyController < ApplicationController def some_action render :update do |page| page.replace_html ''an_element'', some_private_method end end private def some_private_method return
2008 Mar 17
8
should have_tag outside Rails
Hi Google has not helped me here. I''m looking for a way to use the have_tag assert_select wrapper outside RSpec on Rails (but in a Rails project) so I can use it to check text strings. Has anyone managed this? Thanks Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL:
2008 Mar 13
22
Specifing methods in a steps_for block
Hey list, I''m refactoring some much-used functionality into a common_steps step group. Methods like this are in there: steps_for :common do Given "a number of existing $types?" do |type| @initial_item_count = type.singularize.classify.constantize.count end When "the user adds an invalid $type" do |type| post
2008 Apr 29
5
Sharing: dont_repeat_yourself plugin custom RSpec matcher
I wrote a Rails plugin which uses simian to look for duplicates lines in your code and reports in html format, Textmate or Netbeans. I wrote it using RSpec and I have included a RSpec custom matcher: it { rails_application. with_threshold_of_duplicate_lines(4). should be_DRY } If you use Autotest, your specs will fail the next time you do a nasty copy-paste !!! More details in
2008 May 20
4
mock_model not stubbing model attribtues in view spec
Hi -- I am just getting to grips w/ view specs, and am having an issue with mock_model not stubbing the mocked model''s attributes. For instance, I have the following: <CODE> before do @input_timesheet = mock_model( InputTimesheet ) assigns[:input_timesheet] = @input_timesheet end it "should display a table element" do render
2008 May 18
2
Using Hash to mock classes that respond to :
Hi I''ve been doing this a while now. If I have a class that responds to : [], and all I''m interested in stubbing is that method, then instead of using a mock I just create a hash. (Similarly, you could create an array when you are testing an Enumerable object.) Example from code I just worked on, where uses MigrationGraph#[] looks up graph vertices by name:
2008 Nov 07
15
any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?
-- Sent from my mobile device
2017 Nov 12
2
create waveform sawtooth
My tuneR sawtooth wave function generator is broken. When I use the sine function, I get exactly what I expect: a sine wave whose frequency is defined by the freq parameter. In particular, higher frequencies have shorter wavelengths (more cycles per second means shorter waves). When I create a sawtooth wave, the opposite seems to occur: higher frequencies result in longer waves. But that?s not
2008 May 23
3
RailsExampleGroup
So I have a describe which is a subclass of RailsExampleGroup. I inserted some data into my database, and reconnect! my connection. Before reconnect, finding the data I just created is fine. The data cannot be found, after reconnection, the data is gone. It''s not in the database. It looks to me the data is not actually inserted into the DB at all, just somehow buffered somewhere. Would
2008 Nov 04
9
RSpec and PostgreSQL not playing nicely together
Here is a very simple spec: -- require File.expand_path(File.dirname(__FILE__) + ''/../spec_helper'') describe Product, "The Product model" do describe "When a new blank product object gets created" do before(:each) do @product = Product.new end it "should not be valid" do @product.should_not be_valid
2017 Nov 12
0
create waveform sawtooth
Ccing the maintainer if the tuneR package. Looks to me like sawtooth (and square) don't behave as expected when using xunit="samples". Workaround is to use xunit="time" instead: sawtooth(110,duration=1/100,samp.rate=sample_rate,xunit="time") I looked at the code but found it to be opaque. -- Sent from my phone. Please excuse my brevity. On November 12, 2017
2009 Oct 22
4
spec failing to run specs when spec.opts is present on 1.2.9
Hi I ran across the following when running spec on an old merb app. $ cat spec/spec.opts $ spec spec/models/topic_spec.rb Options written to spec/spec.opts. You can now use these options with: spec --options spec/spec.opts $ cat spec/spec.opts spec/models/topic_spec.rb $ spec spec/models/topic_spec.rb Options written to spec/spec.opts. You can now use these options with: spec --options
2009 Oct 20
8
Stub that returns hash values
Is it possible to create a stub that returns hash values. For example I would like to convert this: @siteItem = stub(''plmSiteItem'', :one => "uno") To something like this: @siteItem = stub(''plmSiteItem'', {''one'' => ''uno'', ''two'' => ''dos''} ) So that I can do this:
2000 Jan 04
1
A clue to solaris problem?
Got this from one of my users today ... ========== sshing did still work last week, but you had to use the blowfish encryption protocol instead of 3des that is used by default. ========== Marc G. Fournier marc.fournier at acadiau.ca Senior Systems Administrator Acadia University "These are my opinions, which are not necessarily
2009 Oct 28
1
Puppet on RHEL3 - ruby-1.8.6 RPM
Hey folks, I know there''s an old thread about this, and the provided solution to make puppet work on RHEL3 was to recompile a more recent version of ruby. However, I think it would be nice to upgrade ruby from 1.6.8 to 1.8.6 with RPM, so here''s a quick tip for those who have to manage RHEL3 servers and would like to do it with puppet: