Sha256: c9c12244e22c3024e634ee47e6ca2b71692dcf9bdd4a8025eb37aaa99234f776

Contents?: true

Size: 1.45 KB

Versions: 18

Compression:

Stored size: 1.45 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "result" do
  before(:all) do
    @r = Result.new({ :name => "testcase_name" }, {})
  end
  describe "verbose_on_error" do
    it "should invoke be_verbose if an error occured" do
      @r.instance_variable_set(:@succeeded, false)
      @r.should_receive(:be_verbose).once
      @r.send(:verbose_on_error, 1)
    end
    it "should not invoke be_verbose if no error occured" do
      @r.instance_variable_set(:@succeeded, true)
      @r.should_receive(:be_verbose).exactly(0).times
      @r.send(:verbose_on_error, 1)
    end
  end
  describe "verbose_on_success" do
    it "should invoke be_verbose in case of an error" do
      @r.instance_variable_set(:@succeeded, false)
      @r.should_receive(:be_verbose).once
      @r.send(:verbose_on_success, 1)
    end
    it "should invoke be_verbose in case of no error too" do
      @r.instance_variable_set(:@succeeded, true)
      @r.should_receive(:be_verbose).once
      @r.send(:verbose_on_success, 1)
    end
  end
  describe "verbose_with_curl" do
    it "should invoke be_verbose in case of an error" do
      @r.instance_variable_set(:@succeeded, false)
      @r.should_receive(:be_verbose).once
      @r.send(:verbose_with_curl, 1)
    end
    it "should invoke be_verbose in case of no error too" do
      @r.instance_variable_set(:@succeeded, true)
      @r.should_receive(:be_verbose).once
      @r.send(:verbose_with_curl, 1)
    end
  end
end


Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
apirunner-0.5.5 spec/result_spec.rb
apirunner-0.5.0 spec/result_spec.rb
apirunner-0.4.10 spec/result_spec.rb
apirunner-0.4.9 spec/result_spec.rb
apirunner-0.4.8 spec/result_spec.rb
apirunner-0.4.7 spec/result_spec.rb
apirunner-0.4.6 spec/result_spec.rb
apirunner-0.4.5 spec/result_spec.rb
apirunner-0.4.4 spec/result_spec.rb
apirunner-0.4.3 spec/result_spec.rb
apirunner-0.4.2 spec/result_spec.rb
apirunner-0.4.1 spec/result_spec.rb
apirunner-0.4.0 spec/result_spec.rb
apirunner-0.3.10 spec/result_spec.rb
apirunner-0.3.9 spec/result_spec.rb
apirunner-0.3.8 spec/result_spec.rb
apirunner-0.3.7 spec/result_spec.rb
apirunner-0.3.6 spec/result_spec.rb