class Object

Constants

OPTS_FILENAME
SPEC_OPTS

Public Instance Methods

assigns(attr) click to toggle source

Parameters

attr<~to_s>

The name of the instance variable to get.

Returns

Object

The instance variable @attr for this object.

Examples

# In a spec
@my_obj.assigns(:my_value).should == @my_value
# File lib/merb-core/test/test_ext/object.rb, line 11
def assigns(attr)
  self.instance_variable_get("@#{attr}")
end
run_spec(spec, base_dir, run_opts = "-fs") click to toggle source
# File lib/merb-core/test/run_spec.rb, line 22
def run_spec(spec, base_dir, run_opts = "-fs")

  $VERBOSE = nil
  err, out = StringIO.new, StringIO.new
  def out.tty?() true end
  options = Spec::Runner::OptionParser.parse(%W(#{spec} --color).concat(%W(#{run_opts})), err, out)
  options.filename_pattern = File.expand_path(spec)
  failure = ! Spec::Runner::CommandLine.run(options)
  File.open(base_dir / "results" / "#{File.basename(spec)}_out", "w") do |file|
    file.puts out.string
  end
  File.open(base_dir / "results" / "#{File.basename(spec)}_err", "w") do |file|
    file.puts err.string
  end
  exit!(failure ? -1 : 0)
end