Sha256: c6d810335d11c04d49de4db3588b74f7684e7d1d13a7fba994bf5723ca1441e4

Contents?: true

Size: 1.46 KB

Versions: 52

Compression:

Stored size: 1.46 KB

Contents

describe "UIImage effects w/ CIImage & CIFilter" do
  before do
    @image = 'little_square'.uiimage
  end

  describe 'should apply a gaussian blur' do
    it 'should have a gaussian_blur method' do
      -> {
        @image.gaussian_blur.should.be.kind_of(UIImage)
      }.should.not.raise
    end
    it 'should accept a :radius option' do
      -> {
        @image.gaussian_blur(radius: 5).should.be.kind_of(UIImage)
      }.should.not.raise
    end
    it 'should accept a :radius argument in 0th position' do
      -> {
        @image.gaussian_blur(5).should.be.kind_of(UIImage)
      }.should.not.raise
    end
  end

  describe 'should apply inverted colors' do
    it 'should have inverted method' do
      -> {
        @image.inverted.should.be.kind_of(UIImage)
      }.should.not.raise
    end
  end

  describe 'should apply a darken filter' do
    it 'should have a darken method' do
      -> {
        @image.darken.should.be.kind_of(UIImage)
      }.should.not.raise
    end
    it 'should accept a :saturation option' do
      -> {
        @image.darken(saturation: 5).should.be.kind_of(UIImage)
      }.should.not.raise
    end
    it 'should accept a :brightness option' do
      -> {
        @image.darken(brightness: 5).should.be.kind_of(UIImage)
      }.should.not.raise
    end
    it 'should accept a :saturation and a :brightness option' do
      -> {
        @image.darken(saturation: 5, brightness: 5).should.be.kind_of(UIImage)
      }.should.not.raise
    end
  end

end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
sugarcube-3.0.4 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.0.3 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.0.2 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.0.1 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.0.0 spec/ios/image_uiimage_filters_spec.rb
sugarcube-2.12.3 spec/ios/image_uiimage_filters_spec.rb
sugarcube-2.12.2 spec/ios/image_uiimage_filters_spec.rb
sugarcube-2.12.1 spec/ios/image_uiimage_filters_spec.rb
sugarcube-2.12.0 spec/ios/image_uiimage_filters_spec.rb
sugarcube-2.11.1 spec/ios/image_uiimage_filters_spec.rb
sugarcube-2.11.0 spec/ios/image_uiimage_filters_spec.rb
sugarcube-2.10.0 spec/ios/image_uiimage_filters_spec.rb
sugarcube-2.9.1 spec/ios/image_uiimage_filters_spec.rb
sugarcube-2.8.2 spec/ios/image_uiimage_filters_spec.rb
sugarcube-2.8.1 spec/ios/image_uiimage_filters_spec.rb
sugarcube-2.8.0 spec/ios/image_uiimage_filters_spec.rb
sugarcube-2.7.1 spec/ios/image_uiimage_filters_spec.rb
sugarcube-2.7.0 spec/ios/image_uiimage_filters_spec.rb
sugarcube-2.6.0 spec/ios/image_uiimage_filters_spec.rb
sugarcube-2.5.0 spec/ios/image_uiimage_filters_spec.rb