Skip to content

Instantly share code, notes, and snippets.

@jcrossley3
Created December 20, 2010 16:42
Show Gist options
  • Save jcrossley3/748607 to your computer and use it in GitHub Desktop.
Save jcrossley3/748607 to your computer and use it in GitHub Desktop.
Spec::Runner.configure do |config|
config.before(:suite) do
configuration = org.jboss.arquillian.impl.XmlConfigurationBuilder.new.build()
Thread.current[:test_runner_adaptor] = org.jboss.arquillian.impl.DeployableTestBuilder.build(configuration)
Thread.current[:test_runner_adaptor].beforeSuite
end
config.before(:all) do
if (self.class.respond_to? :create_deployment)
@real_java_class = self.class.become_java!
Thread.current[:test_runner_adaptor].beforeClass(@real_java_class)
end
end
config.after(:all) do
Thread.current[:test_runner_adaptor].afterClass(@real_java_class) if @real_java_class
end
config.after(:suite) do
Thread.current[:test_runner_adaptor].afterSuite rescue nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment