File: gist_spec.rb

package info (click to toggle)
gist 6.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 372 kB
  • sloc: ruby: 3,277; makefile: 16
file content (23 lines) | stat: -rw-r--r-- 654 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
describe Gist do

  describe "should_be_public?" do
    it "should return false if -p is specified" do
      Gist.should_be_public?(:private => true).should be_falsy
    end

    it "should return false if legacy_private_gister?" do
      Gist.should_receive(:legacy_private_gister?).and_return(true)
      Gist.should_be_public?.should be_falsy
    end

    it "should return true if --no-private is specified" do
      Gist.stub(:legacy_private_gister?).and_return(true)
      Gist.should_be_public?(:private => false).should be_truthy
    end

    it "should return true by default" do
      Gist.should_be_public?.should be_truthy
    end
  end

end