Sha256: fe26875fee9bb2d989ada9871c6d920e01bce334924dc1f55a573aa7afba1e62

Contents?: true

Size: 854 Bytes

Versions: 4

Compression:

Stored size: 854 Bytes

Contents

require File.expand_path("#{File.dirname(__FILE__)}/functional_spec_helper")

describe JsTestCore do
  attr_reader :stdout, :request
  before do
    @stdout = StringIO.new
    JsTestCore::Client.const_set(:STDOUT, stdout)
    @request = "http request"
  end

  after do
    JsTestCore::Client.__send__(:remove_const, :STDOUT)
  end

  it "runs a full passing Suite" do
    JsTestCore::Client.run(:spec_url => "#{root_url}/specs/foo/passing_spec")
    stdout.string.strip.should == JsTestCore::Client::PASSED_RUNNER_STATE.capitalize
  end

  it "runs a full failing Suite" do
    JsTestCore::Client.run(:spec_url => "#{root_url}/specs/foo/failing_spec")
    stdout.string.strip.should include(JsTestCore::Client::FAILED_RUNNER_STATE.capitalize)
    stdout.string.strip.should include("A failing spec in foo fails: expected true to equal false")
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
honkster-screw-unit-server-0.6.3 vendor/js-test-core/spec/functional/functional_spec.rb
honkster-screw-unit-server-0.6.2 vendor/js-test-core/spec/functional/functional_spec.rb
honkster-screw-unit-server-0.6.1 vendor/js-test-core/spec/functional/functional_spec.rb
btakita-screw-unit-server-0.6.0 vendor/js-test-core/spec/functional/functional_spec.rb