Actually, I'm a member of the QA team (limited development experience). So, we are attempting to use RSpec without rails. What is Rake? Near the end of your response, you list a way of running multiple spec files by creating a spec task. Since, I'm not a developer, could you please provide me with a clear example on how to do this? Or, if there is an alternative method on doing this, please let me know. Thanks again.<br>
<br>My current setup is:<br><br>1 spec file that relies on accessing a module of classes to perform Watir web app testing. I've included a sample of the code below<br><br>describe LoginWelcomeScreen do<br> describe "using IE Explorer" do<br>
before(:each) do<br> @login = LoginWelcomeScreen.new(IEWebBrowser.instance) <br> end<br> <br> it "should support a username text field" do<br> @login.test_username_field.should be_an_instance_of(Watir::TextField)<br>
end<br> <br> it "should support a password text field" do<br> @login.test_password_field.should be_an_instance_of(Watir::TextField) <br> end<br>.<br>.<br>.<br>.<br>end<br><br><br><div class="gmail_quote">
On Thu, Jul 10, 2008 at 8:17 PM, Ben Mabey <<a href="mailto:ben@benmabey.com">ben@benmabey.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">Robert Stagner wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm new to RSpec. I've just installed the gem and begun experimenting with developing several scripts. From what I've seen thus far, it looks like it will aid our QA team in testing many web applications. Is there a way to execute multiple rspec test scripts from one central file?<br>
<br>
-- <br>
Regards,<br>
Robert<br>
</blockquote>
<br></div></div>
Robert,<br>
Welcome to rspec! There are a number of ways you can do this. You can<br>
do it with the command line:<br>
spec spec/*_spec.rb<br>
<br>
The way it is generally done is by using a rake task however...<br>
Are you using rails? If so.. have you run "./script/generate rspec"?<br>
That will install a spec task for you so you just have to type "rake<br>
spec" to run all of your specs.<br>
<br>
If you are in a normal ruby app then you can create your own spec task<br>
by putting this in your Rakefile or tasks dir:<br>
<br>
require 'rubygems'<br>
require 'spec'<br>
require 'spec/rake/spectask'<br>
<br>
desc "Run the specs under spec/models"<br>
Spec::Rake::SpecTask.new do |t|<br>
t.spec_files = FileList['spec/*_spec.rb']<br>
end<br>
<br>
If you provide more information on what your setup is we could help more.<br>
<br>
-Ben<br>
<a href="http://benmabey.com" target="_blank">http://benmabey.com</a><br>
<br>
_______________________________________________<br>
rspec-users mailing list<br>
<a href="mailto:rspec-users@rubyforge.org" target="_blank">rspec-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Robert