Sha256: 0c2232211c02625b559af6ff89eeecdc77295d4d12455ef91e94863fbfc75c54

Contents?: true

Size: 693 Bytes

Versions: 10

Compression:

Stored size: 693 Bytes

Contents

require 'helper'

require 'neo/rails/exposure/exposures'

class ExposuresTest < NeoRailsCase
  let(:exposures){ Neo::Rails::Exposure::Exposures.new([:a])}

  test "exposed?" do
    refute exposures.exposed?(:a)
    exposures[:a] = nil
    assert exposures.exposed?(:a)
    refute exposures.exposed?(:b)
    exposures[:a] = 1
    assert exposures.exposed?(:a)
    refute exposures.exposed?(:b)
  end

  test "sets and gets a key" do
    exposures[:a] = "foo"
    assert_equal "foo", exposures[:a]
    assert_equal "foo", exposures.a
  end

  test "raises if a undefined key is set" do
    assert_raises Neo::Rails::Exposure::UndeclaredVariableError do
      exposures[:c] = 1
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
neo-rails-0.4.1 test/fixtures/exposure/exposures_test.rb
neo-rails-0.4.0 test/fixtures/exposure/exposures_test.rb
neo-rails-0.3.2 test/fixtures/exposure/exposures_test.rb
neo-rails-0.3.1 test/fixtures/exposure/exposures_test.rb
neo-rails-0.3 test/fixtures/exposure/exposures_test.rb
neo-rails-0.2.3.1 test/fixtures/exposure/exposures_test.rb
neo-rails-0.2.3 test/fixtures/exposure/exposures_test.rb
neo-rails-0.2.2 test/fixtures/exposure/exposures_test.rb
neo-rails-0.2.1 test/fixtures/exposure/exposures_test.rb
neo-rails-0.2.0 test/fixtures/exposure/exposures_test.rb