Sha256: 01901136337802e15ed3fb1074a97627349a93de5d0c83116f3c92a886bbd659
Contents?: true
Size: 1.23 KB
Versions: 22
Compression:
Stored size: 1.23 KB
Contents
# encoding: utf-8 require 'spec_helper' describe Mutant::Mutator::Node::Literal, 'float' do before do Mutant::Random.stub(float: random_float) end let(:random_float) { 7.123 } context 'positive number' do let(:source) { '10.0' } let(:mutations) do mutations = [] mutations << 'nil' mutations << '0.0' mutations << '1.0' mutations << random_float.to_s mutations << '(0.0 / 0.0)' mutations << '(1.0 / 0.0)' mutations << '(-1.0 / 0.0)' mutations << '-10.0' end it_should_behave_like 'a mutator' end context '0.0' do let(:source) { '0.0' } let(:mutations) do mutations = [] mutations << 'nil' mutations << '1.0' mutations << random_float.to_s mutations << '(0.0 / 0.0)' mutations << '(1.0 / 0.0)' mutations << '(-1.0 / 0.0)' end it_should_behave_like 'a mutator' end context '-0.0' do let(:source) { '-0.0' } let(:mutations) do mutations = [] mutations << 'nil' mutations << '1.0' mutations << random_float.to_s mutations << '(0.0 / 0.0)' mutations << '(1.0 / 0.0)' mutations << '(-1.0 / 0.0)' end it_should_behave_like 'a mutator' end end
Version data entries
22 entries across 22 versions & 1 rubygems