similar to: Can Rspec do module spec? What if module uses test data?

Displaying 20 results from an estimated 2000 matches similar to: "Can Rspec do module spec? What if module uses test data?"

2007 Aug 31
2
Can module spec "behave like" controller spec?
Hello everyone: Right now I am writing spec on modules, which are provided by my colleagues. Some of the modules actually contain action methods. I tried very hard to spec those action methods in modules. But it seems that the rspec does not allow module spec to ''get'' action like controller does. After I saw the documentation, I then used :behaviour_type=>:controller.
2007 Sep 14
6
Need help in View Spec
Hello everyone: I am kind of puzzled in writing spec on view partials. I can not find much information about the "should have_tag" syntax in Rspec. Can rspec test a particular attribute of a tag (e.g. input tag)? Let me put an example here: #../view/group/_index <div id="test"> <input type="button" value="update" onclick="update()"
2007 Aug 07
1
Rspec controller test
Great Hi to everybody! I am currently working on a project which tests the controllers using rspec. I came across some methods in the controller which do not generate any actions at all. However, they still need testing! Some of these methods do require parameters. I am wondering how I can pass the test cases as the parameters to these targeted methods in the controller spec?? Below is a simple
2007 Aug 13
1
Problem of using fixture in Rspec
Dear Fellows: I was using fixtures in the model tests using Rspec. I found that the test data specified in the fixtures was stored in the test database once I ran the spec and won''t be removed anyway. Is my observation correct? There might be another problem regarding the fixtures. When I ran the specs one by one, it was working. However, it failed when I tried to run all the
2007 Aug 13
8
How to use expect_render?
Hi: I am a rspec beginner. I have scratched my head for the whole afternoon, trying to figure out a way of writing render expectation in controller spec. However, I failed. It kept telling me that the ''expect_render'' was an undefined method. I have installed rspec 1.0.8 and rspec_on_rails as well. Below is the controller to be tested. Controller def index pre
2007 Sep 12
8
Can not ''assigns'' value in View test
Hello everyone: I am quit new to View test using rspec. I want to write spec for a partial, which is rendered by a controller. However, the controller does not pass data to the partial using instance variables, it uses symbol variable instead. I read the example of view spec provided in the website. But the example is using instance variable. So I am looking for a way of assigning my test data
2007 Aug 08
1
Failed to pass arguments to controller method
Good morning to everyone: So weird!! I got a method called apply_settings(arg1, arg2) in the controller to be tested. In the controller spec, I of course called the method. In the controller: def apply_settings(arg1, arg2) #where arg1 is a hash, and arg2 is an array of object #do some coding end In the controller spec: before(:each) do @controller = Controller.new
2007 Aug 23
1
Can module spec use fixtures?
Good morning, dear fellows: I''d like to recall one question I posted yesterday. I am writing specs for ruby modules. Some of the modules do some data process in the test database. Because ''fixtures'' is undefined (Am I correct?) in module specs, spec of certain module (e.g. delete data form database) will affect other specs of other modules (e.g. try to access the
2007 Sep 24
2
Is Rcov working with Jruby now?
Hello everyone: I am currently assigned to test a big project which uses JRuby to build a web application. The reason of using JRuby is the web application is communicating with Java Service. I am writing test cases using Rspec and looking for a code coverage tool. Rcov is no doubt a nice code coverage tool. However, it is said that Rcov is not compatible with JRuby so far. Sigh....I can not
2009 Feb 04
7
counting entries in vector
Hi all, I've a vector with entries, which are all of the same type, e.g. string: k <- c("bb", "bb", "bb", "aa", "cc", "cc") and want to create a second vector containing the number of each entry in k in the same order as in k, i.e. c(3, 1, 2) or: k <- c(5,5,5,5,2,2,4) => c(4,2,1) thanks
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
2011 Jan 04
2
Looking for a gem which uses rspec for testing and tests need to deal with database
Let''s say that I develop a gem which adds a new method to ActiveRecord . Now I want to test this method using rspec. I am able to get started but not sure where to put the database.yml for testing purpose. I was wondering if there is a gem out there which uses rspec for testing and has to interact to database for testing. Thanks
2012 Sep 28
2
nested modules and autoloading
All- I''m using puppet 2.7.14. I''ve reviewed http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html but it doesn''t seem to cover what I''m attempting. Consider a module layout like this: $ tree mymodule mymodule |-- Modulefile |-- README |-- manifests | |-- init.pp | |-- special_type | | `-- prereqs.pp | `-- special_type.pp
2013 Dec 02
1
Class parameter flexibility with ENC, hiera or both
Dear puppetteers, I am having a philosophical question about parametrized classes. When building modules, one wants to be as flexible as possible, to try to target as many puppet flavors as possible. This is our target: - Foreman users, using foreman as an ENC with smart variables (or potentially any other ENC, but I would say this is the most widespread one). - Pure Puppet''s site.pp
2003 Apr 28
1
code12 when using modules
Hi I updated my rsync to 2.5.6. Since then, any modules actions don't work anymore. rsync -ravvvn --stats --progress rollis.ch::mymodule ends up in opening tcp connection to rollis.ch port 873 receiving file list ... rsync: connection unexpectedly closed (28 bytes read so far) _exit_cleanup(code=12, file=io.c, line=165): entered rsync error: error in rsync protocol data stream (code 12) at
2008 Feb 18
3
Calling a controller inside a module
I tryied everything: :controller => ''MyModule::Core::Controller'' require ''MyModule/core/controller'' include MyModule::Core But nothing works !!! Question is very simple: How to call a controller that belongs to a Module inside the router.rb file? This cannot be that difficult! Thanks! -Sergio -------------- next part -------------- An HTML attachment
2011 Nov 11
2
[LLVMdev] Argument's types mismatch when creating CallInst.
Hello. I have an .bc, which defines @foo(%type* arg1, %type* arg2, %type* arg3). Firstly, i do this: runtimeModule = getLazyIRFileModule("runtime.bc", smd, llctx); then this: fooFunction = runtimeModule->getFunction("foo"); myType = runtimeModule->getTypeByName("type"); After that, i'm creating another module: myModule = new Module("My
2010 Jun 23
3
Custom default form builder in Rails 3
Hello everyone, I am trying to set a default custom form builder. I have defined my form builder class in "lib/mymodule/mybuilder.rb" as: module Mymodule class Mybuilder < ActionView::Helpers::FormBuilder ...... end end Then I am trying to use this custom class in application.rb as config.action_view.default_form_builder = Mymodule::Mybuilder. But I get "Uninitialized
2012 Aug 17
8
Class Naming Convention
So, this has always puzzled me a bit. By convention, init.pp contains one class, named the same as the module. However, what is the convention when the module may have multiple external access points? Say you have a module called ''syslog'' which provides both a client and a server class. I typically have used syslog::server and syslog::client. I''ve ended up using this
2013 Nov 05
1
[LLVMdev] Thread-safe cloning
Sorry to resurrect an old thread, but I finally got around to testing this approach (round tripping through bitcode in memory) and it works beautifully - and isn't that much slower than cloning. I have noticed however that the copy process isn't thread-safe. The problem is that in Function, there is lazy initialization code for arguments: void CheckLazyArguments() const { if