RSpec Code Examples

 

 

basic rails2 asset test
should work for rails2 at root context
should work for rails2 at non-root context
basic knob compatibility
should be able to autoload from TB path conventions
it should behave like basic rails2 tests
should return a basic page
should send data
should send file
basic archive knob compatibility
it should behave like basic rails2 tests
should return a basic page
should send data
should send file
no web: section in torquebox.yml
it should behave like basic rails2 tests
should return a basic page
should send data
should send file
messaging rails test
json encoding
should send and receive
rails app with netty.jar
should work
no torquebox tests
should not throw error about requiring torquebox-messaging
cached javascript from an archive
should verify cached javascript works
torquebox thor utility tests
torquebox archive
should archive an app from the root
should archive an app with a root specified
should archive and deploy an app from the root
should archive and deploy an app with a root specified
torquebox deploy
should deploy a basic app
should deploy an app with a name specified on the command line
should deploy an app with a context path specified on the command line
should deploy an app with an environment specified on the command line
should deploy an app with a root specified on the command line
torquebox run
should pass JVM options specified on the command line
shared runtime pooling
it should behave like configured pool
should be the proper pool type
bounded runtime pooling
it should behave like configured pool
should be the proper pool type
min/max settings
should have the proper min setting
should have the proper max setting
an app using a torquebox.rb
external tests
should have the correct environment vars
settings in the external descriptor should override
should have a pool specified with a hash
expected: not nil
     got: nil
./spec/torquebox_rb_spec.rb:27:in `(root)'
./target/rspec-runner.rb:97:in `(root)'
-e:1:in `(root)'
25        pool = mbean('torquebox.pools:name=foo,app=an_app_using_a_torquebox_rb')
26      }.should_not raise_error(javax.management.InstanceNotFoundException)
27      pool.should_not be_nil
28      pool.minimum_instances.should == 0
29      pool.maximum_instances.should == 6
30# gem install syntax to get syntax highlighting
should have a pool specified as a block
expected: not nil
     got: nil
./spec/torquebox_rb_spec.rb:37:in `(root)'
./target/rspec-runner.rb:97:in `(root)'
-e:1:in `(root)'
35        pool = mbean('torquebox.pools:name=cheddar,app=an_app_using_a_torquebox_rb')
36      }.should_not raise_error(javax.management.InstanceNotFoundException)
37      pool.should_not be_nil
38      pool.minimum_instances.should == 0
39      pool.maximum_instances.should == 6
40# gem install syntax to get syntax highlighting
should have a queue we specify
should have a topic we specify
should not have a backgroundable queue (options_for w/a disable)
expected Java::JavaxManagement::InstanceNotFoundException, got #<RuntimeError: no locally attacheable VMs>
./spec/torquebox_rb_spec.rb:55:in `(root)'
./target/rspec-runner.rb:97:in `(root)'
-e:1:in `(root)'
53    
54    it "should not have a backgroundable queue (options_for w/a disable)" do
55      lambda { 
56        mbean('org.hornetq:module=JMS,type=Queue,name="/queues/torquebox/an_app_using_a_torquebox_rb/tasks/torquebox_backgroundable"')
57      }.should raise_error(javax.management.InstanceNotFoundException)
58# gem install syntax to get syntax highlighting
should create a job
no locally attacheable VMs
./spec/spec_helper_integ.rb:14:in `mbean'
./spec/torquebox_rb_spec.rb:61:in `(root)'
./target/rspec-runner.rb:97:in `(root)'
-e:1:in `(root)'
12
13def mbean(name)
14  JMX::MBean.establish_connection :command => /org.jboss.as.standalone/i
15  JMX::MBean.find_by_name(name)
16end
17# gem install syntax to get syntax highlighting
should create a processor with a hash
no locally attacheable VMs
./spec/spec_helper_integ.rb:14:in `mbean'
./spec/torquebox_rb_spec.rb:67:in `(root)'
./target/rspec-runner.rb:97:in `(root)'
-e:1:in `(root)'
12
13def mbean(name)
14  JMX::MBean.establish_connection :command => /org.jboss.as.standalone/i
15  JMX::MBean.find_by_name(name)
16end
17# gem install syntax to get syntax highlighting
should create a processor with a block
no locally attacheable VMs
./spec/spec_helper_integ.rb:14:in `mbean'
./spec/torquebox_rb_spec.rb:74:in `(root)'
./target/rspec-runner.rb:97:in `(root)'
-e:1:in `(root)'
12
13def mbean(name)
14  JMX::MBean.establish_connection :command => /org.jboss.as.standalone/i
15  JMX::MBean.find_by_name(name)
16end
17# gem install syntax to get syntax highlighting
should create allow a singleton processor
no locally attacheable VMs
./spec/spec_helper_integ.rb:14:in `mbean'
./spec/torquebox_rb_spec.rb:81:in `(root)'
./target/rspec-runner.rb:97:in `(root)'
-e:1:in `(root)'
12
13def mbean(name)
14  JMX::MBean.establish_connection :command => /org.jboss.as.standalone/i
15  JMX::MBean.find_by_name(name)
16end
17# gem install syntax to get syntax highlighting
should create a service with a hash
no locally attacheable VMs
./spec/spec_helper_integ.rb:14:in `mbean'
./spec/torquebox_rb_spec.rb:87:in `(root)'
./target/rspec-runner.rb:97:in `(root)'
-e:1:in `(root)'
12
13def mbean(name)
14  JMX::MBean.establish_connection :command => /org.jboss.as.standalone/i
15  JMX::MBean.find_by_name(name)
16end
17# gem install syntax to get syntax highlighting
should create a service with a block
no locally attacheable VMs
./spec/spec_helper_integ.rb:14:in `mbean'
./spec/torquebox_rb_spec.rb:92:in `(root)'
./target/rspec-runner.rb:97:in `(root)'
-e:1:in `(root)'
12
13def mbean(name)
14  JMX::MBean.establish_connection :command => /org.jboss.as.standalone/i
15  JMX::MBean.find_by_name(name)
16end
17# gem install syntax to get syntax highlighting
should create a service with the same class as another service
no locally attacheable VMs
./spec/spec_helper_integ.rb:14:in `mbean'
./spec/torquebox_rb_spec.rb:97:in `(root)'
./target/rspec-runner.rb:97:in `(root)'
-e:1:in `(root)'
12
13def mbean(name)
14  JMX::MBean.establish_connection :command => /org.jboss.as.standalone/i
15  JMX::MBean.find_by_name(name)
16end
17# gem install syntax to get syntax highlighting
in container
should have an authentication domain
should allow for multiple authentication domains
should pass configuration to the service
should pass configuration to the service from a block
should pass configuration to the job
should set the default message encoding
task concurrency
backgroundable tasks
it should behave like concurrent processors
should have concurrent processors
expected #has_content?("tasks fired") to return true, got false
./spec/task_concurrency_spec.rb:27:in `(root)'
./target/rspec-runner.rb:97:in `(root)'
-e:1:in `(root)'
25      path = "/task-concurrency?#{@type}" 
26      visit path
27      page.should have_content('tasks fired')
28      responses = Set.new
29      100.times do
30# gem install syntax to get syntax highlighting
/app/tasks tasks
it should behave like concurrent processors
should have concurrent processors
messaging rack test
should receive a ham biscuit
should receive a topic ham biscuit
in-container messaging tests
message enumeration
should allow enumeration of the messages
should accept a selector
message priorities
should be fifo for same priority messages
should send higher priority messages first
message ttl
should live
should die
message selectors
should be able to select with property set to true using selector 'prop = true'
should be able to select with property set to true using selector 'prop <> false'
should be able to select with property set to 5 using selector 'prop = 5'
should be able to select with property set to 5 using selector 'prop > 4'
should be able to select with property set to 5.5 using selector 'prop = 5.5'
should be able to select with property set to 5.5 using selector 'prop < 6'
should be able to select with property set to string using selector 'prop = 'string''
sending and receiving
with an encoding of clojure
should be able to publish to and receive from a queue
should be able to publish a hash to and receive from a queue
with an encoding of json
should be able to publish to and receive from a queue
should be able to publish a hash to and receive from a queue
with an encoding of marshal
should be able to publish a string to and receive from a queue
should be able to publish a complex type to and receive from a queue
should receive a binary file correctly
should publish to multiple topic consumers
synchronous messaging
should return value of block given to receive_and_publish
should return request message if no block given
should not mess up with multiple consumers
should allow a selector to be passed
with an encoding of marshal_base64
should be able to publish a string to and receive from a queue
should be able to publish a complex type to and receive from a queue
should receive a binary file correctly
should publish to multiple topic consumers
synchronous messaging
should return value of block given to receive_and_publish
should return request message if no block given
should not mess up with multiple consumers
should allow a selector to be passed
with an encoding of default
should be able to publish a string to and receive from a queue
should be able to publish a complex type to and receive from a queue
should receive a binary file correctly
should publish to multiple topic consumers
synchronous messaging
should return value of block given to receive_and_publish
should return request message if no block given
should not mess up with multiple consumers
should allow a selector to be passed
destination not ready
should block on publish until queue is ready
should block on receive until topic is ready
should block until startup_timeout reached
messaging alacarte rack test
should work
jaas
should authenticate against 'torquebox' with proper credentials
should authenticate against 'torquebox' as guest
should not authenticate against 'torquebox' with improper credentials
should authenticate against 'torquebox-jaas' with proper credentials
should not authenticate against 'torquebox-jaas' with improper credentials
rackup files don't have to reside at the root
should be happy
loading torquebox.rb from a knob
should have loaded torquebox.rb
runtime injection
should be able to grab the runtime analyzer
should be able to perform analysis at runtime
sinatra queues test
should scream toby crawley
jobs check
should be employed
HA jobs test
standalone
should still work
basic bundler test with rack
should work with an old version of rack gem
rails vendor/jars/-based jar loading
should work
authentication
should work for HTTP basic authentication
basic sinatra test
should work
should return a valid request scheme
should return a static page beneath default 'public' dir
should post something
should allow headers through (JRUBY-5839, TORQUE-430)
should test Sir Postalot
basic production
should work
should cache pages correctly
frozen gems
should include all required gems in its vendor directory
exposing app name to rack app
set the constant and env var
rails 2 backgroundable tests
it should behave like rails backgroundable tests
should reload the model in the task runtime
rails 3 backgroundable tests
it should behave like rails backgroundable tests
should reload the model in the task runtime
end-to-end twitter testing
should retrieve the index using a Capybara DSL
in-container tests
should be running remotely
jruby profile.api and rails3.1 test
should use the profile api successfully
rack reloading
should reload
rails PWD-based jar loading
should work
transactions testing
should not hang when receive times out
should publish a message when no error occurs
should retry delivery when an error is tossed
should rollback published messages when an error is tossed
should receive a message in the processor's transaction
should rollback message when explicit transaction fails
should support nested messaging transactions
should support nested messaging transactions, the latter new
should rollback cache transactions
should rollback nested cache transactions
should rollback nested messaging transactions
should rollback nested messaging transactions, the latter new
should not rollback non-transactional messages
sequel support
should work for in-memory H2 databases
backgroundable tests
should wait asynchronously
should properly handle backgrounded methods on reloaded classes
rails 3.0 transactions testing
it should behave like transactions
should save a simple thing
should create a Thing in response to a happy message
should not create a Thing in response to an error prone message
should continue to have surprising behavior with nested non-TorqueBox transactions
should have less surprising behavior wrapped in a TorqueBox transaction
should support :requires_new for creating models in TorqueBox transactions
should support :requires_new for updating models in TorqueBox transactions
should save to multiple class-specific databases in a TorqueBox transacation
should rollback from multiple class-specific databases in a TorqueBox transacation
should rollback as expected for a non-XA connection
should rollback as expected for an XA connection
should rollback correctly when nesting a non-TorqueBox tx in a TorqueBox one
should rollback correctly when nesting two TorqueBox transactions
rails 3.1 transactions testing
it should behave like transactions
should save a simple thing
should create a Thing in response to a happy message
should not create a Thing in response to an error prone message
should continue to have surprising behavior with nested non-TorqueBox transactions
should have less surprising behavior wrapped in a TorqueBox transaction
should support :requires_new for creating models in TorqueBox transactions
should support :requires_new for updating models in TorqueBox transactions
should save to multiple class-specific databases in a TorqueBox transacation
should rollback from multiple class-specific databases in a TorqueBox transacation
should rollback as expected for a non-XA connection
should rollback as expected for an XA connection
should rollback correctly when nesting a non-TorqueBox tx in a TorqueBox one
should rollback correctly when nesting two TorqueBox transactions
rails3 injection test
should work for services defined in app/services
should work for jobs defined in app/jobs
should work for tasks defined in app/tasks
should work for predetermined injectables
should work for calls to __inject__
should work for Enumerables
padrino sass test
should do a basic get
jdk apis
should be exposed
basic rails3.2 test
should do a basic get
should support class reloading
STOMP applications via websockets
should be able to connect and disconnect using stomp over websockets
should be able to subscribe send and receive
should be able to subscribe send and receive from JMS, transactionally
basic tests with environment variables in database.yml
it should behave like basic rails3 test
should do a basic get
should do a raw post
should support injection
should default to development environment
should support environment variables in database.yml
should support environment variables from torquebox.yml
archive knobs with environment variables in database.yml
it should behave like basic rails3 test
should do a basic get
should do a raw post
should support injection
should default to development environment
should support environment variables in database.yml
should support environment variables from torquebox.yml
environment variables in an archive knob
it should behave like basic rails3 test
should do a basic get
should do a raw post
should support injection
should default to development environment
should support environment variables in database.yml
should support environment variables from torquebox.yml
rack PWD-based jar loading
should work
sprockets 2.1 and rails3.1 test
should do a basic get
rack lib/-based jar loading
should work
sinatra with dm-infinispan-adapter
should work
should list muppets
should find muppets by name
should find muppets by id
should find muppets by num
should find muppets by range
should find muppets by inclusive range
should find muppets by like
should find muppets by date range
should delete muppets
should index records (PENDING: No reason given)
basic rails3 with cache test
should deploy, at least
should use ActiveSupport::Cache::TorqueBoxStore
should perform caching
should transactionally cache objects in the store
should rollback failed transactional cache objects in the store
jobs alacarte
it should behave like alacarte
should detect activity
should have its init params
modular jobs alacarte
it should behave like alacarte
should detect activity
should have its init params
modular jobs alacarte with torquebox.rb
it should behave like alacarte
should detect activity
should have its init params
services alacarte
it should behave like alacarte
should detect activity
should have its init params
services alacarte with gemfile
should not break when using a Gemfile
backgroundable simple gem tests
should wait asynchronously
should properly handle backgrounded methods on reloaded classes
vhost rack test
should work
basic rack test with heredoc
it should behave like basic rack
should work
should be running under the proper ruby version
should not have a vfs path for __FILE__
basic rack test with hash
it should behave like basic rack
should work
should be running under the proper ruby version
should not have a vfs path for __FILE__
STOMP applications
should be able to connect and disconnect using pure stomp
should be able to connect and disconnect using pure stomp over websockets
should be able to subscribe
should be able to subscribe send and receive
should be able to subscribe send and receive against JMS queues
should be able to subscribe send and receive against JMS queues, transactionally
rails3 form handling
should render properly the first time
should support flash uploading by matrix url
shared destinations test
should work with foo
should work with bar
activerecord padrino test
should do a basic get
should be able to login to the admin console
exploded internal
it should behave like internal overrides
should return correct environment variables
it should behave like all overrides
should return correct static content
should return correct RACK_ENV
should return correct RACK_ROOT
archived internal
it should behave like internal overrides
should return correct environment variables
it should behave like all overrides
should return correct static content
should return correct RACK_ENV
should return correct RACK_ROOT
exploded external
it should behave like external overrides
should return correct environment variables
it should behave like all overrides
should return correct static content
should return correct RACK_ENV
should return correct RACK_ROOT
archived external
it should behave like external overrides
should return correct environment variables
it should behave like all overrides
should return correct static content
should return correct RACK_ENV
should return correct RACK_ROOT
autoload rails3.1 test
should do a get to the test page
basic rails3.1 asset test
should serve assets from app/assets
should generate correct asset and link paths
alacarte runtime initialization test
torquebox_init
should work
basic war
should work
padrino injection test
should inject from app.rb
should inject from models
should inject from lib
should inject from controller
basic rails3.1 test
should do a basic get
should support injection
messaging rack test
should receive a topic ham biscuit
no locally attacheable VMs
./spec/spec_helper_integ.rb:14:in `mbean'
./spec/durable_processor_spec.rb:18:in `(root)'
./target/rspec-runner.rb:97:in `(root)'
-e:1:in `(root)'
12
13def mbean(name)
14  JMX::MBean.establish_connection :command => /org.jboss.as.standalone/i
15  JMX::MBean.find_by_name(name)
16end
17# gem install syntax to get syntax highlighting
durable topics
receive
should be durable
unsubscribe
should work
sinatra queues rootless test
should scream toby crawley
jobs check
should be employed
services
should keep state after start and stop
no locally attacheable VMs
./spec/spec_helper_integ.rb:14:in `mbean'
./spec/spec_helper_integ.rb:19:in `get_msc_service_state'
./spec/spec_helper_integ.rb:33:in `verify_msc_service_state'
./spec/services_spec.rb:20:in `(root)'
./target/rspec-runner.rb:97:in `(root)'
-e:1:in `(root)'
12
13def mbean(name)
14  JMX::MBean.establish_connection :command => /org.jboss.as.standalone/i
15  JMX::MBean.find_by_name(name)
16end
17# gem install syntax to get syntax highlighting
rack vendor/jars/-based jar loading
should work
basic rack test with service injection
should work
rails lib/-based jar loading
should work
in container futures tests
futures from backgroundable
it should behave like something with a future
should work
should raise the remote error
should set the status
futures from /app/tasks
it should behave like something with a future
should work
should raise the remote error
should set the status
basic rails3 asset test
root context
should generate correct asset and link paths
should return correct Content-Type header
non-root context
should generate correct asset and link paths
should return correct Content-Type header
torquebox-messaging with datamapper
should support always_backgrounded jobs on DataMapper::Resource
should support ad hoc backgrounded jobs on DataMapper::Resource
sinatra with TorqueBox sessions
should retain session data after redirect
should timeout after specified time
archived rackup files don't have to reside at the root
should be happy
rake tasks
should pass a sanity check
TorqueBox::DeployUtils
should use a valid cluster config file
torquebox:archive
should create archives
should create an archive with a name supplied on the command line
should create an archive with a name supplied as an env variable
torquebox:deploy and torquebox:undeploy
should do a basic yaml deployment
should do a yaml deployment with a context supplied on the command line
should do a yaml deployment with a name supplied on the command line
should do a yaml deployment with a name supplied as an env variable
should treat undeployment of a non-existent yaml deployment as a noop
torquebox:deploy:archive and torquebox:undeploy:archive
should do a basic archive deployment
should do a archive deployment with a name supplied on the command line
should do a archive deployment with a name supplied as an env variable
should treat undeployment of a non-existent archive deployment as a noop
should be able to undeploy an archive using only torquebox:undeploy
rails2 sessions
it should behave like session handling
should behave reasonably
should reset session data after logout
should work via matrix url
should support session language crossing
should reset and restore
rails3 sessions
it should behave like session handling
should behave reasonably
should reset session data after logout
should work via matrix url
should support session language crossing
should reset and restore