testing

rake task on gem

I have a rake task for a series of rspecs as follows... require 'spec/rake/spectask' require 'joliscrapper' namespace :spec do desc "Web scraping files" task :scrapers => :environment do Spec::Rake::SpecTask.new do |t| t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""] t.spec_files = FileList['spec/scr...

Is there a tool for Java RMI testing like SoapUI does for web services?

I'm looking for a (GUI?) tool that can connect to RMI services and display the results. Sort of like how SoapUI allows you to specify a WSDL, generated test input and execute the call. I would like to specify an RMI destination (i.e. rmi://server:port/package/class.method(parameters, ...) ) and test the RMI call. Bonus if it can save ...

Does the Mac Developer Program have old versions of Mac OS X?

I'm developing something for Mac OS X. It's a port of a Windows product. One of my boss' concerns is how it will run on older versions of Mac OS X. I know Xcode has facilities for compiling for old versions of Mac OS X, but QA would prefer to actually run the older versions of Mac OS X on a Macintosh. Since we got into Macintosh devel...

Determine if Equals() is an override?

I have an instance of Type (type). How can I determine if it overrides Equals()? ...

What not to test in Rails?

I've been writing tests for a while now and I'm starting to get the hang of things. But I've got some questions concerning how much test coverage is really necessary. The consensus seems pretty clear: more coverage is always better. But, from a beginner's perspective at least, I wonder if this is really true. Take this totally vanilla c...

Android WebView SSL 'Security Warning'

I'm building a test version of an app for a client. Part of this app uses a WebView that calls out to a SSL-based site. In turn, the client has provided a test domain where the certificate name does not match the FQDN. Alas, they are not in a position to provision a cert that matches. :( I'm working around this issue on the companion iO...

Good book on testing for a dev?

Hi, As a developer, we are required to test our code to some extent to find bugs (destructive/negative testing mainly, and unit tests). What is a good book that covers the level of testing a developer has to do and the best way to do it/best practises? The book can briefly list the types of testing a dev doesn't usually do (e.g. load te...

How to test an application is working frequently by performing a fundamental action (non interactively)

Hi, We want to test a connection to an application as a feature of a program we are developing, but to go further with this, we want to actually do a sort of diagnostic test to ensure that the app is working and not just take the service status as gospel (the main windows service running does not mean the app is working fully). However...

Easy way to switch a back and forth between a real and mock data service for a Flex 4 application?

I have a Flex 4 client application that is under development in parallel with the server back-end. I am use Mate's MockRemoteObject to provide a mock data service, but as the real data service comes on line, we'll want to run against that sometimes from Eclipse. Is there a way to easily switch between the two without having to modify s...

Get HTTP response Using Shoulda Ruby on Rails

I'm migrating over to shoulda from rspec and I can't seem to get access to the http response. Can someone point out what I may be doing wrong? context "doing somethin" do setup do get :index end @response.body should respond_with :success end When i run this i get an error saying that @response is a...

Factory Girl with has many relationship (and a protected attribute)

Hello, I have this kind of relation: class Article < ActiveRecord::Base has_many :comments end class Comment < ActiveRecord::Base belongs_to :article attr_protected :article_id end The default scenario inside controllers looks like: @article = Article.create(:title => "foobar") @comment = @article.comments.create(:content => ...

Tests for more inputs

Hi, I'm using MSTest for testing and when I want to apply more inputs then the test looks like this: [TestMethod] public void SumTest() { // data to test var items = new [] { new { First = 1, Second = 1, Expected = 2 }, new { First = -1, Second = 1, Expected = 0 }, new { First = 1, Second = 2, Expected = 3 }, new { ...

Setting up a web testing environment

We have a need to set up a testing environment to test our pages output. I'm reluctant to use Selenium, because we just don't have the hardware to do it. I'm also more concerned with whether there is content on the page, than whether the page "looks" right. From that, I'm looking to set up something command-line, that we can pass in a...

individual spec passes when run alone, but fails when all specs are run

I have 30 specs in my foo_controller_spec.rb and when I run the entire file using spec, I get 4 failures and 2 pending. When I run the 4 failing specs individually, 3 of them still fail, but one of them passes. At first I thought it was a database issue, that the data wasn't being cleaned out properly between runs. So I installed databas...

Can someone describe to me what RSpec 2 is doing in this?

I have been attempting to dive into RSpec 2 but its auto generated controller specs do not work for any version of RSpec 2 with any version of Ruby or any version of Rails. Maybe I'm missing something obvious? def mock_category(stubs={}) @mock_category ||= mock_model(Category, stubs).as_null_object end describe "GET show" do it "as...

Rails 3 - Testing if View calls a method

Hi, I'm starting to learn Rails. I'm using Rails 3. In my simple App, I have the following code: <% @tasks.each do |task| %> ... <td><%= friendly_estimate task.estimate, { :compact => true } %></td> ... <% end %> The mission for me is that I would like to test if the view really sends the :compact option to my method to ensu...

Odd errors when testing on iphone, after device is disconnected

I've noticed that when I upload my code to my test device, it works fine... right up to the point that I unplug it from the computer. I assume this is because it needs to connect to the debugger or something, but I'd very much like to ensure that the program will work once it's distributed. How should I go about setting up the program so...

Internal implementation of .NET HashSet contains method?

Hello, I am writing a test for my library written in C#. And I want to test whether two list are same if and only if they have same elements(do not require elements in the same order). I try to convert list to hashset and check whether the two hashset are same. But the running result is not what I expected. Could anyone explain how the...

Accessing child attributes from parent Factory Girl factories

I'm implementing Factory Girl as a replacement for fixtures in my Rails app. I have several tables that I'm trying to represent using associations. However, to throw a kink into the loop, beyond just defining the associations, I also need to access attributes of the child factories from the parent. Below is an example of what I'm tryi...

Factory_girl has_one relation with validates_presence_of

I have 2 Models: # user.rb class User < ActiveRecord::Base has_one :profile, :dependent => :destroy end # profile.rb class Profile < ActiveRecord::Base belongs_to :user validates_presence_of :user end # user_factory.rb Factory.define :user do |u| u.login "test" u.association :profile end I want to do this: @user = Factory...